- 1

Explain the code

Output is 1

25th Mar 2020, 7:11 PM
Ajith
Ajith - avatar
7 Réponses
+ 5
Ajith first you need to know that a condition either returns true or false which is also represented by a 1 and 0 in C. i = x<y<z; So the compiler checks whether x<y which is 10<20 and it is true so it returns 1. Now the next condition is checked which is whether 1<20 and it is true again and it also returns 1 which is stored in 'i'.
25th Mar 2020, 7:48 PM
Avinesh
Avinesh - avatar
25th Mar 2020, 7:14 PM
Asmit joy
Asmit joy - avatar
+ 1
Ajith what's you question bro??
25th Mar 2020, 7:17 PM
Asmit joy
Asmit joy - avatar
0
int x=10,y=20,z=5,i; i=x<y<z; printf ("%d\n",i);
25th Mar 2020, 7:14 PM
Ajith
Ajith - avatar
0
I posted in comment
25th Mar 2020, 7:17 PM
Ajith
Ajith - avatar
0
Output is 1
25th Mar 2020, 7:17 PM
Ajith
Ajith - avatar
0
Okie thank you again
25th Mar 2020, 7:55 PM
Ajith
Ajith - avatar