What is the output of the following statements?
for(i=10; i++; i<15)
printf("%d ", i);
for(i=10; i++; i<15)
printf("%d ", i);
A. 10 11 12 13 14
B. 10 11 12 13 14 15
C. 9 10 11 12 13
D. Infinite loop
E. None of these
Answer: Option D
Solution(By Examveda Team)
Since the condition is always true it will go to infinite loop.
Join The Discussion
Comments ( 2 )
Which control structure is used to repeatedly execute a block of code in C?
A. for loop
B. if statement
C. switch case
D. while loop
In C, what is the purpose of the 'break' statement within a loop?
A. Continue to the next iteration
B. Exit the program
C. Terminate the loop and exit it
D. Skip the current iteration
What is the purpose of the 'else' statement in C's 'if-else' control structure?
A. Execute the 'if' block
B. Execute the 'else' block
C. Execute both 'if' and 'else' blocks
D. Skip the 'if' block
Which control structure is used to make a decision between two or more alternatives in C?
A. switch case
B. for loop
C. if statement
D. while loop
Suppose that x,y,z, and w are int variables, and x=3, y=4, z=7, and w=1. What is the output of the following statements?
a) cout
what will happen on 32-bit machine when i reaches to 0 almost after (0xffffffff -10).