Conditional statements control how your program behaves based on certain conditions. C++ supports if
, else if
, else
, and switch
for decision-making.
{ }
braces for multiple statements inside if
, else if
, or else
blocks — even though it's optional for single lines.
==
— Equal to!=
— Not equal to>
— Greater than<
— Less than>=
— Greater than or equal to<=
— Less than or equal tobreak
in each case
inside a switch
, or it'll "fall through" to the next case.