Vidyalelo
C Programming · Q45

Control Structures

Programming · C Programming · question 45

Q45

What will be the output of the following code? #include void main() int s=0; while(s++<10) if(s<4 && s<9) continue; printf("%dt", s);

A.
1 2 3 4 5 6 7 8 9
B.
1 2 3 10
C.
4 5 6 7 8 9 10
Answer
D.
4 5 6 7 8 9
E.
None of these

Answer: Option C

Solution

Answer: Option C
Solution:
'If' statement only true when value of 's' is less then 4

Control Structures mcq solution image