0

Can you explain why i am getting z=0 as output?

#include <stdio.h> int main() { int x=3,y,z; x=y=10; z=x<10; printf("\nx=%d y=%d z=%d",x,y,z); return 0; }

26th Dec 2019, 5:36 AM
Raxstar AD
Raxstar AD - avatar
1 Réponse
+ 10
Raxstar AD you have assigned x and y with 10 by this statement. x=y=10 And in next statement z=x<10 by which z= 10<10 and this is false so return 0 and this 0 will assign to z so that's why z is printed as 0
26th Dec 2019, 5:41 AM
GAWEN STEASY
GAWEN STEASY - avatar