Vidyalelo
C Programming · Q146

Control Structures

Programming · C Programming · question 146

Q146

What will be the output of the following C code? #include void main() int i = 0; while (i < 10) i++; printf("hi "); while (i < 8) i++; printf("hello ");

A.
Hi is printed 8 times, hello 7 times and then hi 2 times
B.
Hi is printed 10 times, hello 7 times
C.
Hi is printed once, hello 7 times
D.
Hi is printed once, hello 7 times and then hi 2 times
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board