CS 200 - Lab 16

Reversing a Sequence

Write a program to read 10 integer values from the user and then print out the values in reverse order.

Example run (user input in bold red):

Enter 10 int values:
42 19 13 68 64 92 15 65 22 6
Reversed sequence:
6 22 65 15 92 64 68 13 19 42

Getting started

If you have a solution open in Visual Studio, close it (File->Close Solution).

Download lab16.zip.  Import it into Visual Studio (File->Import...).

Add your code to the source file called Reverse.c.


Use an array of int values to store the sequence entered by the user.

Start out by sketching your algorithm in pseudo-code.  Using an example input sequence (such as the one above), use a pen and paper example to step through your algorithm.  Make sure that it correctly reverses the input sequence.