Vidyalelo
C Programming · Q120

Control Structures

Programming · C Programming · question 120

Q120

What will be the output of the following C code? #include int main() short i; for (i = 1; i >= 0; i++) printf("%d ", i);

A.
The control won't fall into the for loop
B.
Numbers will be displayed until the signed limit of short and throw a runtime error
C.
Numbers will be displayed until the signed limit of short and program will successfully terminate
Answer
D.
This program will get into an infinite loop and keep printing numbers with no errors

Answer: Option C

Solution

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