Homework Assignment 3 Solutions
Solutions:
- Write the program CountUp.C which prompts for an integer called
bingo and
prints on separate lines the integers 1 through bingo in sequence,
and then prints "Bingo!".
Solution
- Write the program BoxOfStars.C which prompts for two integers
called starCount and lineSize and prints starCount asterisks (*)
on several lines if necessary, so that each line has at most lineSize
asterisks on it.
Solution
- Write the program TriangleOfStars.C which prompts for the
integer called baseSize and prints asterisks (*) baseSize on the
first line, baseSize-1 on the second line, and so on, until one
asterisk on the baseSize-th line.
Solution
- Write the program Euclidean.C which accepts two integers called
i and j and finds the greatest common divisor of the two.
Solution