What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
Error
constants
variable
Text
String
Character
Integer
Float
enum
It allows the use of multiple alternatives for an expression
It is used to execute code conditionally based on the evaluation of a Boolean expression
It is used to execute a sequence of statements multiple times
It allows the execution of code based on multiple expressions
int
char
long
all of the mentioned
short
float
All of the above
do-while
if-else
for
while
end;
break;
Stop;
A semicolon.
In the following nested conditional statements, which branch will execute?
int x = 4;if (x > 2) { if (x < 5) { printf("x is between 2 and 5"); }} else { printf("x is 2 or less");}
x is between 2 and 5
x is 2 or less
No output
What is the output of the following code?
int a = 5, b = 10;if (a < b)printf("a is less than b");elseprintf("a is greater than or equal to b");
a is greater than or equal to b
a is less than b
Compiler Error
Undefined
int x = 5;if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
No Output
default case is optional inside switch.
break; causes the control to exit the switch immediately and avoid fall down to other CASE statements.
You can not use duplicate CASE Constants inside a Switch construct.
All the above.