6 Answers
New AnswerBcz all non-zero numbers are considered as 1. Logic gates give ans in Boolean type only . i.e 1 , 0.
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
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message