C++ program for accepting 'n' number of values and printing it in reverse order.

 

Here is a simple c++ program for C++ program for accepting 'n' number of values and printing it in reverse order. 

- Dinesh Kumar E

Code:

#include<iostream>
using namespace std;
int main()
{
int i,j,mat[i];
cin>>i;
j=i;
for(i=0;i<j;i++)
{
cin>>mat[i];
}
for(i=j-1;i>=0;i--)
{
cout<<mat[i]<<' ';
}
}

Comments

Popular Posts