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

  • 0 replies
  • 512 views
*

Offline mechanic

  • *****
  • 2461
    • 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


 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
type: "engrz" without quotes: