Homework 20: Stack-based arrays
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Monday, March 6
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw20and submit using the204subcommand. - This is an electronic homework and you do not need to print out anything to turn in during class.
Assignment
- Required reading: Sections 1 (Stack-based arrays) and 2 (Strings are arrays) from the Unit 6 notes,
-
Write a program
reverse.cthat reads in an integer for the size of your array, then declares and array ofints of that size, reads then in, and then prints them back out in reverse order.Example runs:
roche@ubuntu$./reverseHow many numbers?4Enter 4 numbers:1 2 3 44321roche@ubuntu$./reverseHow many numbers?7Enter 7 numbers:5 8 2 1 3 9 66931285roche@ubuntu$./reverseHow many numbers?1Enter 1 numbers:33