Ask the user to enter an integer (n) Declare an array of size n with double data type. Ask the user to enter the values of the array. Create another array with of size n with integer data type. Make a copy of the first array to the second array but in reverse order (e.g., the last element in the first array should be store in the first element in the second array and so on). Output values stored in the two arrays. Find and output how many odd values in both arrays are equal based on the index number, i.e. count matching values of two arrays based on same index value AND the element value of the array. Sample Input/output Enter n:4 Enter array values: 1 2 3 4 First Array :1 2 3 4 Second Array:4 3 2 1 # of Equal values = 0 Enter n:5 Enter array values: 1 2 3 4 5 First Array :1 2 3 4 5 Second Array:5 4 3 2 1 # of Equal values = 1
Ask the user to enter an integer (n)
Declare an array of size n with double data type.
Ask the user to enter the values of the array.
Create another array with of size n with integer data type.
Make a copy of the first array to the second array but in reverse order (e.g., the last element in the first array should be store in the first element in the second array and so on).
Output values stored in the two arrays.
Find and output how many odd values in both arrays are equal based on the index number, i.e. count matching values of two arrays based on same index value AND the element value of the array.
Sample Input/output
Enter n:4
Enter array values:
1 2 3 4
First Array :1 2 3 4
Second Array:4 3 2 1
# of Equal values = 0
Enter n:5
Enter array values:
1 2 3 4 5
First Array :1 2 3 4 5
Second Array:5 4 3 2 1
# of Equal values = 1
Step by step
Solved in 4 steps with 2 images