• Yaho!: Easiest question ever(judge the output)

    What should be the output of this program?

    void main()
    {
      int y=5,z=6;
      if(y || ++z)
      {  
       printf("\ny=%d",y);
       printf("z=%d",z);

      }


    }


    output:

    y= ?(guess)
    z=?(guess)

9 comments:

  1. Unknown said...

    If you don't know the answer, do join this site for all latest updates.

    and ask for the solution too

  2. Unknown said...

    infinite loop

  3. Unknown said...

    Buddy, how can it be a loop when there is no loop in this program????

  4. Jonah said...

    5 & 6 since the first condition is true it doesn't go to check the second condition and hence the o/p. :)

  5. Unknown said...

    great buddy!!
    Only you replied it correctly!!!

    Good!!!

  6. grvsngh said...

    error bcoz there is an extra closing braces...
    if one closing braces will be removed then o/p will be
    5 nd 6

  7. Unknown said...

    that was a syntactical error .
    Removed now!!

  8. tapas said...

    5 and 6 .. as in OR condition if the thing left to OR is true then it doesnt go to check what is in its right.. so it wont go till ++z and print 5 and 6

  9. Unknown said...

    Absolutely correct!!

Post a Comment