Logic

This algorithm in real does not produces a reversed array. Instead it just prints array in reverse order. If you are looking to reverse the elements then skip to next logic. So here goes step by step descriptive logic to print array in reverse order.

1.Input size and elements in array from user. Store it in some variable say size and a[].

2.Run a loop from size - 1 to 0 in decremented style. The loop structure should look like for(i=size-1; i>=0; i--).

3.Inside loop print current array element i.e. a[i].

Print Reverse an Array

#include <stdio.h>

int main() {

int a[100],i, j, Size;

printf ("\n Please Enter the size of an array:");

scanf("%d",&Size);

for(i =0; i < Size; i++){

    scanf("%d", &a[i]);

}

j = i -1;

printf ("\n Result of an Reverse array is:");

for (i = j; i >=0; i--) {

     printf("%d \t", a[i]);

}

return 0;

}

Output

Please Enter the size of an array:5

10 20 30 40 50

Result of an Reverse array is:50 40 30 20 10