Homework Assignment 3 Solutions

Solutions:
  1. 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

  2. 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

  3. 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

  4. Write the program Euclidean.C which accepts two integers called i and j and finds the greatest common divisor of the two.
    Solution