if (1 == 2) if (1 == 2) { cout << "Strange "; cout << "Strange "; cout << "Mathematics"; cout << "Mathematics";}
if (1 == 2) if (1 == 2) cout << "Strange "; cout << "Strange "; cout << "Mathematics"; else else cout << "Plain "; cout << "Plain "; cout << "Mathematics"; cout << "Mathematics";
if ... if ... else ...
, does the else
belong to
the first or second if
?
if (a<b || a==b) if (a<b && a==b) cout << "a not > b"; cout << "a not > b"; else cout << "a > b"; else cout << "a > b";
a>b
is equivalent to:
b<a b<a || b==a
a<=b
is equivalent to:
b>a || b==a ! (b<=a)
a<b
is equivalent to:
b>a || b==a ! (b<=a)
a<1 || a>3 && a!=0
is equivalent to:
a<1 || (a>3 && a!=0) (a<1 || a>3) && a!=0
a
is zero?