CPS 125 

				Alexander Ferworn

					LAB 4


Purpose: This lab is to have you design and write your first C
language program from a stated problem.

a)   Write a C program using proper form which will place a
prompt on the screen asking for the input of 5 integer numbers. 
The program should then input five integer values into five
appropriately named variables.  The program should echo (output
immediately) the input values to the screen, appropriately
labelled.

The program should then produce and output to the screen
(appropriately labelled) the following:  i) the sum of the five
values, ii) the difference of the third minus the second values,
and iii) the square root of the floating point quotient produced
by dividing the product of the first three values by the sum of
the last two values (select your data so as to produce a non-
integer quotient).  

To compile a program requiring functions from the mathlibrary, 
use cc -lm filename.c


b)   Run your program a second time but use redirection to take
the input from a data file named lab4.data (which you are to
create with 5 integer data values) and send the output to a file
lab4.output, both files in your cps125 subdirectory.  Note that 
the prompt line will now be sent to the output file - file I/Oseen 
later in the course will avoid this problem.

     
c)   Modify your program to produce different spacings of the
output values.  Run the program again with the redirection as
above. 

d)   Modify the data file to become a contiguous series of digits
(no spaces in between the digits).  Then modify your program to
use input field widths to produce the five inputs from the
modified data file.  Run several trials with the redirected
input, but with the output going to the screen.