The elements of the array are taken as input. The program reverses the array elements and stores them into another array in reverse order.
INPUT: The array elements
OUTPUT: The Reversed array
PROCESS:
Step 1: [taking inputs from user]
Read n [number of elements]
For i=0 to n-1 repeat
Read a[i]
[End of ‘for’ loop]
Step 2: [Finding the reverse of the array]
j=0
for i=n-1 to 0 repeat
b[j]=a[i]
Set j<j+1
[End of ‘for’ loop]
Step 3: Stop.
Related