C++ Programming Code Examples C++ > Arrays and Matrices Code Examples Program to Reverse an Array Program to Reverse an Array Array store all data in array on the basis of index. For reverse an array element you nedd to interchange elements of array on the basis of index value. . #include<iostream.h> #include<conio.h> void main() { int a[20],b[20],x,j,n; clrscr(); cout<<"How many elements you want to enter: "; cin>>n; cout<<"Enter any "<<n<<" elements in Array: "; for(x=0; x<n ;x++) { cin>>a[x]; } cout<<"Reverse of Array: "; for(x=n-1,j=0; x>=0;x--,j++) { b[x]=a[j]; } for(x=0; x<n ;x++) { cout<<b[x]; } getch(); }