rishcool94

sort array no

Dec 14th, 2011
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<iostream.h>
  2. void main(){
  3.  
  4. int a[10][10],n,m;
  5. cout<<"cout enter no of rows";
  6. cin>>m;
  7. cout<<"enter no of columns";
  8. cin>>n;
  9. int i=0,j=0;
  10. for(i=0;i<m;i++)
  11. for(j=0;j<n;j++)
  12. {
  13. cout<<"enter value a["<<i<<"]["<<j<<"]";
  14. cin>>a[i][j];
  15. }
  16.  
  17. for(i=n;i>=0;i--){
  18. for(j=0;j<m;j++){
  19. a[j][i]=a[j][i-1];
  20. }
  21. }
  22. for(j=0;j<m;j++){
  23. a[j][0]=a[j][n];
  24. }
  25. for(i=0;i<m;i++){
  26. for(j=0;j<n;j++){
  27. cout<<a[i][j];
  28. }
  29. cout<<endl;
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment