题目内容

What will the following program print on screen? int age = 0; if (age = 40) printf("Happy Birthday!"); else printf("Sorry");

A. Happy Birthday!
B. Runtime error.
C. Sorry
D. Nothing; the program will not compile.

查看答案
更多问题

What will the following program print on screen? int age = 40; if (40 = age) printf("Happy Birthday!"); else printf("Sorry");

A. Happy Birthday!
B. Runtime error.
C. Sorry
D. Nothing; the program will not compile.

What will the following program print on screen? int tenure = -10; if (tenure + 5) printf("Congratulations!"); else printf("Sorry");

A. Congratulations!
B. Runtime error.
C. Sorry
D. Nothing; the program will not compile.

In a switch statement, if the break statements are omitted, all cases following the matching case value, including the default case, are executed.

A ____ statement is a specialized selection statement that can be used in place of an if-else chain where exact equality to one or more integer constants is required.

A. case
B. break
C. switch
D. nested if

答案查题题库