Control Structure Questions and Answers
Practice ModeShowing 10 of 97 questions
Q1
Which of the following is a selection statement?
Answer: Option C
Q2
The value in the expression of a switch statement can't be
Answer: Option D
Q3
Find the output?
void main ( )
{
int a=5;
if (a++, a--,a)
printf("hellow");
else
printf("byte");
}
Answer: Option A
Q4
In switch statement, wehch of the following is/are true?
I. Only constant value is applicable.
II. Character constants are automatically converted to integers.
III. Nested if can be used in case statements.
Answer: Option A
Q5
Find the output.
void main ( )
{
goto start;
{
int a=1;
start:printf ("%d',a);
}
}
Answer: Option C
Q6
Switch-case statement does not implement on
Answer: Option C
Q7
Find the output
void main ( )
{
int i=1;
while (i<=5)
{
printf("%d", i);
if (i==2) continue;
i++;
}
}
Answer: Option A
Q8
Find the output
void main ( )
{
int i=1;
if (++i)
if (i++)
printf("%d", i);
else
printf("%d", i);
}
Answer: Option C
Q9
Which one is best suited for control statements?
I. To alter the flow of a program
II. Test the logical conditions
III. Control the flow of execution as per the selection.
Answer: Option D
Q10
Find the output
void main ( )
{
int x=5, 5f;
switch (x++)
{
case x*1:
printf("raja"):
break;
case x*2:
printf(rani");
break;
default:
printf("fool");
}
}
Answer: Option C