+ 2
Need a little help
#include<stdio.h> int main () { int a=10, b=20, c=30; if (c>b>a) printf("True"); else printf("False"); return 0; } I compiled it, and answer is false.. why??
1 Answer
+ 39
Rewrite the if statement like this:
c > b && b > a
Reason why you get false:
c > b - the result is true,
true > a - the result is false.
https://www.sololearn.com/learn/CPlusPlus/1619/