Question: Write a program in C++ to read n integers into an array and display it in reverse order. Ask the user for the integers of

Write a program in C++ to read n integers into an array and display it in reverse order.

  • Ask the user for the integers of values to read - (this value will be less than 25)
    • Input the number of integers to store in the array: 3
    • echo print the input
  • Read the elements into the array using format - (you should echo print the input)
 Input 3 integers: integer - 0 : 2 integer - 1 : 5 integer - 2 : 7 
  • Expected Output :
 The values stored into the array are : 2 5 7 The values stored into the array in reverse are : 7 5 2 
  • Also report:
    • The sum of all elements of the array
    • The total number of duplicate elements in the array.
    • The maximum and minimum element in the array

[edit]Sample Run

Input the number of elements to store in the array: 10 Input 10 integers: integer - 0 : 1 integer - 1 : 2 integer - 2 : 3 integer - 3 : 4 integer - 4 : 3 integer - 5 : 2 integer - 6 : 1 integer - 7 : 9 integer - 8 : 8 integer - 9 : 7 The values stored into the array are : 1 2 3 4 3 2 1 9 8 7 The values stored into the array in reverse are : 7 8 9 1 2 3 4 3 2 1 The sum of all elements of the array is 40 The total number of duplicate elements in the array is 3 The maximum and minimum element in the array are 1 , 9 

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 Databases Questions!