3.4. Summary
- Like Python C++ also supports the
if-else
conditional statements, and they behave the same way as they do in a Python program.
- Unlike Python, C++ does not support the use of the
elif
statement. However, you can get the functionality of an elif
statement by nesting if
and else
statements in C++.
- C++ also supports a
switch
statement that acts something like the elif statement of Python under certain conditions.
- C++ supports the use of Boolean expressions in
if-else
statements.
Next Section - 3.5. Glossary