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

 Write a C program, reverse_array . c, which reads integers 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: $ doc reverse_array.c -o reverse_array $ ./reverse_array Enter numbers forwards: 10 50 20 40 Ctri-D Reversed: 40 20 50 10 $ ./reverse_array Enter numbers forwards: -5 -4 -3 -1 Ctri-D Reversed: 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

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!