Question: Write a C program, reverse array.c, which reads integers line by line, and when it reaches the end of input, prints those integers in

  1. Write a C program, reverse array.c, which reads integers line by line,

Write a C program, reverse array.c, which reads integers line by line, and when it reaches the end of input, prints those integers in reverse order, line by line. You will never be given more than 100 integers to print out The output from your program should look exactly like this: s dcc reverse_array.c -o reverse_array $/reverse_array Enter numbers forwards: 10 50 20 Ctrl-D 40 Reversed: 40 20 50 10 /reverse_array Enter numbers forwards: -5 -4 -3 -2 Ctri-D 1 Reversed: -1 -2 -3 -4 -5 Need a Hint? The result from calling scanf can be assigned to an integer, like so int scanned_in_value; int result scanf("%d", &scanned_in_value); result will be equal to the number of variables that scanf successfully scanned in. Explanation In the code sample above, if the user does enter a number, scanf will be able to read this in to the variable scanned_in_value,

Step by Step Solution

3.29 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!

Related Book