The following program fragment if(a = 7) printf("a is seven"); else

  • 0 replies
  • 720 views
*

Offline mechanic

  • *****
  • 2566
    • View Profile
    • Engineering Forum
Question: The following program fragment

if(a = 7)
printf("a is seven");
else
printf("a is not seven");


results in the printing of?

Options are:

A. a is seven
B. a is not seven
C. Nothing
D. garbage

Correct answer is:

A. a is seven