Consider the following C program:
Which one of the following statements is CORRECT?
c
- AThe program prints 9 as output
- BThe program prints 10 as output
- CThe program gets stuck in an infinite loop
- DThe program prints 6 as output
Programming in CData Types, Syntax, Control Structures, LoopsMCQ1 mark · −1/3 if wrongMedium
1# include <stdio.h>
2int main( ) {
3 int a = 6;
4 int b = 0;
5 while (a < 10) {
6 a = a/12 + 1;
7 a += b;
8 }
9 printf("%d", a);
10 return 0;
11}
12A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.