Friday 22 March 2013

while(+(+i--)!=0)


    main()
{
    int i=0;
    while(+(+i--)!=0)
         i-=i++;
    printf("%d",i);
}
Answer:
-1
Explanation:
Unary + is the only dummy operator in C. So it has no effect on the expression and now the while loop is,     while(i--!=0) which is false and so breaks out of while loop. The value –1 is printed due to the post-decrement operator.

Blog Author: Vijay Kumar

No comments:

Post a Comment