Friday 22 March 2013

while(i++!=0);


    main()
{
    unsigned int i=65000;
    while(i++!=0);
    printf("%d",i);
}
Answer:
 1
Explanation:
Note the semicolon after the while statement. When the value of i becomes 0 it comes out of while loop. Due to post-increment on i the value of i while printing is 1.

Blog Author: Vijay Kumar

No comments:

Post a Comment