Answer to Question #15866 in C++ for Diwakar
What will be the output of the given program and why?
main()
{
int x=3,y,z;
y=x=10;
z=x<10;
printf("\n x=%d y=%d z=%d",x,y,z);
}
1
2012-10-04T09:48:23-0400
int x=3,y=0,z;
y=x=10; // <-- x and y set to 10
z=x<10; // <-- z is set to 0, as the logical expression "x<10"is false
printf("
x=%d y=%d z=%d",x,y,z); // output will be: x=10 y=10 z=0
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment