QUIZ 61

What is the output ?

int i=0;
for(i=1;i<5;i+=3);
{
printf("%d",i);
}

a) 1
b) 4
c) 7
d) 0

Answer : (c)

Explanation :

In first iteration, i<5  —>   i+=3   —>  i=4
In second iteration,  i<5  —>  i+=3   —>   i=7
After this i>5, loop terminates.

Leave a Reply

Your email address will not be published. Required fields are marked *