The following program fragment if (a = 0) printf("a is zero");

  • 0 replies
  • 570 views
*

Offline mechanic

  • *****
  • 2490
    • View Profile
    • Engineering Forum
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