Top

Discussion

What will be the output of the program?

#include
int main()
{
    int x=1, y=1;
    for(; y; printf("%d %d\n", x, y))
    {
        y = x++ <= 5;
    }
    printf("\n");
    return 0;
}

 

  • A.2 1
    3 1
    4 1
    5 1
    6 1
    7 0
  • B.2 1
    3 1
    4 1
    5 1
    6 1
  • C.2 1
    3 1
    4 1
    5 1
  • D.2 2
    3 3
    4 4
    5 5

Answer: A

No answer description available for this question.
 

No comment is present. Be the first to comment.
Loading…

Post your comment