Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Wednesday, February 1
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw09and submit using the
- This is an electronic homework and you do not need to print out anything to turn in during class.
- Required reading: Section 5 (Nested loops & Stepwise refinement) from the Unit 3 notes, Note: You do not need to go through the full example in section 5.4 (stepwise refinement from the inside out) if you will be in class.
Write a program called
counting.cthat reads an integer \(n\) from the user, and then uses a nested loop to count from 1 up to 1, then from 1 up to 2, then from 1 up to 3, etc., and finally from 1 up to \(n\).
Example of running your program:
1 2 3
1 2 3 4
1 2 3 4 5
Note: be careful not to print an extra space at the end of each line!