C - Control Flow Constructions Questions and Answers
Practice ModeShowing 10 of 62 questions
Q31
When is default statement executed in swich-case construct ?
Answer: Option D
Q32
C is an example of
Answer: Option B
Q33
The syntax of if statement is
Answer: Option B
Q34
main ( )
{
int a = 2, b = 4, c =8, x =4;
if ( x == b ) x = a; else x = b;
if ( x ! = b ) c = c + b ; else c = c +a ;
printf ( "c = %d\n", c );
}
What will be printed when the above code is executed ?
Answer: Option D
Q35
main ( )
{
unsigned int x = -10; int y = 10 ;
if ( y <= x ) printf ("He is good \n");
if ( y = = ( x = -10) ) printf (" She is better/n");
if ( ( int ) x = = y) printf ("It is the best\n");
}
What will be the output of above sample code ?
Answer: Option D
Q36
If ( 3.14) printf (" The vaLue of exponent\");
else printf ("The value of PIE is used in conditional part\n");
What might bethe result ?
Answer: Option B
Q37
main ( )
{
int x ;
If ( x > 4 ) printf ( "Brindha");
else if ( x > 10 ) printf ( " Karthik");
else if ( x > 21) printf ( " Pradeep");
else printf (" Sandeep");
}
What will be the value of x so that "Karthik" willbe printed?
Answer: Option D
Q38
main ( )
{
i = 0; j = 0;
for ( j = 1; j <10; j++)
{i = i+1; }
}
In the (generic) segment above, what will be the value of the variable i on completion ?
Answer: Option C
Q39
main ( )
{
int x = 0;
for ( (x = 1; x < 4; x++);
printf (" x =%d\n", x);
}
What will be printed when the above sample is executed ?
Answer: Option D
Q40
main ( )
{
int x = 0;
for (; ; )
{
if (x++ = 4) break ;
continue;
printf ("x=%d\n",x);
what will be printed when the above code is executed ?
Answer: Option D