Give the output on the screen of the following program
#include <stdio.h>
int main()
{
int x , y ,z;
x = y = z = 1;
x += y += z;
printf("%d\n", x < y ? y : x);
printf("%d\n",x < y ? x++:y++); printf("%d\n",x);printf("%d\n",y);
printf("%d\n",z += x < y ? x ++ : y++); printf("%d\n",y);printf("%d\n",z);
x = 3; y = z = 4;
printf("%d\n",(z >= y >= x) ? 1 : 0);
printf("%d\n", z >= y && y >= x); z = x / ++ x;
printf("%d\n",x);printf("%d\n",z); return 0;
}
Difficulty level
This exercise is mostly suitable for students
3
2
3
3
4
4
4
0
1
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Replace the first occurrence of a string in an another string