Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- void main(){
- int a[10][10],n,m;
- cout<<"cout enter no of rows";
- cin>>m;
- cout<<"enter no of columns";
- cin>>n;
- int i=0,j=0;
- for(i=0;i<m;i++)
- for(j=0;j<n;j++)
- {
- cout<<"enter value a["<<i<<"]["<<j<<"]";
- cin>>a[i][j];
- }
- for(i=n;i>=0;i--){
- for(j=0;j<m;j++){
- a[j][i]=a[j][i-1];
- }
- }
- for(j=0;j<m;j++){
- a[j][0]=a[j][n];
- }
- for(i=0;i<m;i++){
- for(j=0;j<n;j++){
- cout<<a[i][j];
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment