Code:-
#include<iostream>
using namespace std;
void main()
{
int arr1[5],arr2[5];
//Input
cout<<"Enter 5 Elements = "<<endl;
for(int i=0;i<5;i++)
{
cin>>arr1[i];
}
//Output
cout<<"Output in Reverse Order also all array store in arr2 in reverse order = "<<endl;
for(int j=4, i=0;j>=0&&i<5;i++,j--)
{
arr2[i]=arr1[j];
cout<<arr2[i]<<endl;
}
}
Output
#include<iostream>
using namespace std;
void main()
{
int arr1[5],arr2[5];
//Input
cout<<"Enter 5 Elements = "<<endl;
for(int i=0;i<5;i++)
{
cin>>arr1[i];
}
//Output
cout<<"Output in Reverse Order also all array store in arr2 in reverse order = "<<endl;
for(int j=4, i=0;j>=0&&i<5;i++,j--)
{
arr2[i]=arr1[j];
cout<<arr2[i]<<endl;
}
}
Output
0 Questions:
Post a Comment