/*Matrix Reverse program*/
#include <iostream>
#include <conio>
void main()
{
int arr[5][5],a,b,i,j;
cout<<"Enter Row\t\t";
cin>>a;
cout<<"Emter Coloum\t\t";
cin>>b;
cout<<"Enter element\n";
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
cin>>arr[i][j];
}
}
cout<<"The matrix is A is\n\n";
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
cout<<"Reverse OF A\n\n";
for(i=a-1;i>=0;i--)
{
for(j=0;j<b;j++)
{
cout<<arr[i][j]<<" ";
} cout<<endl;
}
getch();}
0 comments:
Post a Comment