C Programming - Control Instructions - Discussion
Discussion Forum : Control Instructions - Find Output of Program (Q.No. 13)
13.
What will be the output of the program?
#include<stdio.h>
int main()
{
int x=1, y=1;
for(; y; printf("%d %d\n", x, y))
{
y = x++ <= 5;
}
printf("\n");
return 0;
}
Discussion:
46 comments Page 4 of 5.
Krithik said:
10 years ago
Thanks everyone for giving the time to explain this.
Raja said:
1 decade ago
thanks for explination.give brief explination
Ranjana said:
1 decade ago
Because x got post incremented at each step.
Kaira said:
6 years ago
Agree @Renuka!
Please, anyone, explain it.
Please, anyone, explain it.
(2)
Manoja V. said:
8 years ago
Thanks for the explanation @Kiran.
(1)
Ramnayan said:
1 decade ago
Thanks for explanation mishra ji.
Amar said:
1 decade ago
Thanks for the explanation!!
Kailash singh said:
1 decade ago
Thank you for explanation.
Bhargav said:
9 years ago
Thank you all my friends.
Ashwini said:
1 decade ago
THANX 4 YOUR EXPLANATION
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers