Author Topic: The following program fragment if(a = 7) printf("a is seven"); else  (Read 756 times)

Offline mechanic

Advertisement
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


Engineering Forum