0
How do I solve this
cout <<((1>2)?3:4)
5 Answers
+ 5
Please review ternary operator and remember to use the search bar before posting to avoid duplicates.
http://www.cplusplus.com/forum/articles/14631/
+ 1
(1>2) is a condition if it is true then the output will be 3. if it is false the output will be 4.
0
What this does is checking if 1 is bigger than 2. If it is, 3 is being printed, if not, 4 is printed. 1 is obviously smaller than 2, so 4 is being printed.
0
thanks and what does the ? stand for
0
It is a part of that expression, after it there follows what should happen if the condition is true