177k views
3 votes
Write a C program that:

Strikethrough
-Asks the user to enter 5 numbers
a)Store the numbers in an array
b)Use loops for input and printing
-Prints those numbers back out to the screen
a)All numbers on the same line (with spaces between)
-Prints the numbers in reverse order
a)All numbers on the same line (with spaces between)
-Prints the first number
-Prints the last number
-Prints the maximum number entered
-Prints the minimum number entered

User Noam Gal
by
8.3k points

1 Answer

1 vote

Final answer:

To write a C program that asks the user to enter 5 numbers, stores them in an array, and performs various operations on the numbers.

Step-by-step explanation:

  1. Declare an array variable to store the numbers entered by the user.
  2. Use a loop to prompt the user to enter 5 numbers and store them in the array.
  3. Use another loop to print out the numbers stored in the array, with spaces between them.
  4. Using a loop again, print out the numbers in reverse order.
  5. Access the first element of the array and print it.
  6. Access the last element of the array and print it.
  7. Create variables to keep track of the maximum and minimum number entered.
  8. Use a loop to iterate through the array and update the maximum and minimum variables accordingly.
  9. Print out the maximum and minimum numbers.
User Resnyanskiy
by
8.4k points