+ 3

A statement (a=!5>10)evaluates to zero.How?

Ambiguity in stamentent

26th Jan 2018, 6:07 PM
prathamesh mahangade
prathamesh mahangade - avatar
3 Answers
+ 26
What language?
26th Jan 2018, 6:39 PM
Igor Makarsky
Igor Makarsky - avatar
+ 4
when we write parenthesis according precendense: a =( (!5) > 10) and variable a will be 0. in K&R C and old ANSI C we have not boolean type and boolean values represented by integers. zero represent a False value, and any non-zero integer represent a True value. 5 is not zero and a True. !5 is False and zero. 0 < 10 is a False and zero. a = 0 assign a to zero and all expression value is zero (or False)
26th Jan 2018, 6:39 PM
Š’Š°ŃŠøŠ»ŠøŠ¹ Š”Š°Š²ŠµŠ»ŃŒŠµŠ²
Š’Š°ŃŠøŠ»ŠøŠ¹ Š”Š°Š²ŠµŠ»ŃŒŠµŠ² - avatar
+ 2
c
26th Jan 2018, 6:41 PM
prathamesh mahangade
prathamesh mahangade - avatar