Question: Write a C + + program to do the following: 1 . Declare one array with five integers. 2 . Accept inputs from user to

Write a C++ program to do the following:
1. Declare one array with five integers.
2. Accept inputs from user to assign value to this array.
3. Swap the last and the second last element from this array using the following function
(the declaration must be as follows):
void swap(int *ptr1, int *ptr2);
4. Display the final array.

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!