#include <stdio.h>
#include <conio.h>
int main(){
int i,n,ii,a[100],b[100];
printf("Enter the number of elements in array: ");scanf("%d", &n);
printf("Enter the array elements\n");
for (i=0;i<n;i++){scanf("%d", &a[i]);}
for(i=n-1,ii=0;i>=0;i--,ii++){b[ii]=a[i];}
for(i=0;i<n;i++){a[i]=b[i];}
printf("Reverse Order\n");
for(i=0;i<n;i++){printf("%d\n",a[i]);}
getch();
}
Output:
Comments
Post a Comment