Lab 11

  1. Rewrite Example 1 from the Lab 11 PowerPoint without a nested loop (i.e., with just a single loop).
  2. Write a complete C++ program that does the following:
  3. Sample run of program:
    Enter an odd integer between 5 and 25: 3 Invalid input! Enter an odd integer between 5 and 25: 5 1 3 5 3 9 15 5 15 25
  4. Write a complete C++ program that does the following:
  5. Sample run of program:
    Enter a positive integer: 7 1 the sum is 1 1 2 the sum is 3 1 2 3 the sum is 6 1 2 3 4 the sum is 10 1 2 3 4 5 the sum is 15 1 2 3 4 5 6 the sum is 21 1 2 3 4 5 6 7 the sum is 28

  6. Write a complete C++ program that does the following.
  7. For example, the first 4 lines of output read as follows:
    1 the sum is 1 2 3 4 the sum is 9 3 4 5 6 7 8 9 the sum is 42 4 5 6 7 8 9 10 11 12 13 14 15 16 the sum is 130

  8. Write a complete C++ program that generates a multiplication table of custom dimensions by doing the following:
  9. Once you have the multiplication table in place, try modifying the code to produce the table below. Full credit given for just completing the bulleted items above.
    Enter number of rows: 4 Enter number of columns: 3 1x1=1 2x1=2 3x1=3 1x2=2 2x2=4 3x2=6 1x3=3 2x3=6 3x3=9 1x4-4 2x4=8 3x4=12