printf("%d",x&&y); what will be the output explain
8/19/2019 1:10:37 PM
Every number is true (except 0)
Bcz all non-zero numbers are considered as 1.
Logic gates give ans in Boolean type only . i.e 1 , 0.
Why 2 and 5 are true??
Thanks for clearing my doubts
All non-zero values considered as 'True-1', when they used with logical operators like - && :logical AND, ||: logical OR.
HOPE THIS HELPS...!!
x && y: Checks if both values are true. 2 is true, 5 is true, therefore x && y is true. There aren't really booleans in C, so the output will be the number 1
Send us a message