Skip to main content
Contents
Dark Mode Prev Up Next Scratch ActiveCode Profile
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 3.4 Summary & Reading Questions
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.
Reading Questions Reading Question
1.
You have attempted
of
activities on this page.