Author Topic: The following program fragment if (a = 0) printf("a is zero");  (Read 700 times)

Offline mechanic

Advertisement
Question: The following program fragment

if (a = 0)
printf("a is zero");
else
printf("a in not zero);


Results in the printing of

Options are:


A. a is zero
B. a is not zero
C. nothing
D. garbage

Correct answer is:

B. a is  not zero


Engineering Forum