int
char
short
float
end;
break;
Stop;
A semicolon.
constants
variable
Text
String
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
What is the output of the following code?
int a = 5, b = 10; if (a < b) printf("a is less than b"); else printf("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
Error
No Output
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 will the following code print?
int x = 5; if (x = 0) printf("Zero"); else printf("Not zero");
Zero
Not zero
Compilation error
switch
while
do while
for
is executed only once if the condition is true.
is also known as entry-controlled loop.
is executed at least once if the condition is false.
is unconditional looping statement..
0
Infinitely
1
Variable
for (i=1; i < 20; i++) printf ("k");
for (i=1; i = 20; i++) printf ("k");
for (i=0; i < 20; i++) printf ("k");
for (i=0; i <= 20; i++) printf ("k");
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
is executed only once if the conditions is true
is also known as entry-controlled loop
is executed at least once if the conditions is false
the unconditional loop
break
exit(0)
abort()
All of the mentioned
Loop statement
Conditional Statement
Block Statement
All of the above
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
5
6
12345
For loop
While loop
do-while loop
None of the mentioned
it is assumed to be present and taken to be false
it is assumed to be present and taken to the true
it result in a syntax error
execution will be terminated abruptly
For
Do while
do For
While