+ 2

Why output is 1 ?

Code : #include <stdio.h> int main() { int x,y,z; x=y=4; z=x==y; printf("%d",z); }

27th Jan 2022, 8:56 AM
saurav
saurav - avatar
1 Answer
+ 2
x == y returns true, and if you convert a Boolean true to an integer it becomes 1
27th Jan 2022, 9:45 AM
khabz01
khabz01 - avatar