Examveda
Examveda

What is the output of the following statements?
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.


This Question Belongs to C Program >> Control Structures

Join The Discussion

Comments ( 2 )

  1. AKMAL NUR
    AKMAL NUR :
    3 years ago

    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

  2. Kashyap Patel
    Kashyap Patel :
    8 years ago

    what will happen on 32-bit machine when i reaches to 0 almost after (0xffffffff -10).

Related Questions on Control Structures