# SI 204 Spring 2017 / HWs

This is the archived website of SI 204 from the Spring 2017 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.

# Homework 20: Stack-based arrays

Name: _____________________________________________ Alpha: ___________________

• Due before class on Monday, March 6
• This homework contains code to be submitted electronically. Put your code in a folder called hw20 and submit using the 204sub command.
• This is an electronic homework and you do not need to print out anything to turn in during class.

# Assignment

1. Required reading: Sections 1 (Stack-based arrays) and 2 (Strings are arrays) from the Unit 6 notes,
2. Write a program reverse.c that reads in an integer for the size of your array, then declares and array of ints of that size, reads then in, and then prints them back out in reverse order.

Example runs:

roche@ubuntu$./reverse How many numbers? 4 Enter 4 numbers: 1 2 3 4 4 3 2 1 roche@ubuntu$ ./reverse
How many numbers? 7
Enter 7 numbers: 5 8 2 1 3 9 6
6
9
3
1
2
8
5
roche@ubuntu\$ ./reverse
How many numbers? 1
Enter 1 numbers: 3
3