Skip to main content
Contents Index
Search Book
Search Results:
No results.
Readability settings Prev Up Next
\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\Q}{\mathbb Q}
\newcommand{\R}{\mathbb R}
\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 10.5 Continue to Practice Your Advanced Branching!
Subsection 10.5.1 Practice 3
Activity 10.6 .
Okay, time to try it out. Take a look at the output of the program. Is this what you came up with? If not, do you understand the difference? Please ask questions if anything is unclear.
admin ..... open in new window
Subsection 10.5.2 Practice 4
Activity 10.7 .
Below is a program that calculates the factorial of a number, for example, when N=5, N! = 5*4*3*2*1 = 120.
Modify this program so that it prints a list of the factorials from 1! to 10!, that is something like:
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
...
Your program should use nested loops to accomplish this task.
admin ..... open in new window