Computer Science, asked by prathm2281, 8 months ago

Raju has a square-shaped puzzle made up of small square pieces containing numbers on them. He wants to rearrange the puzzle by changing the elements of a row into a column element and column element into a row element. Help Raju to solve this puzzle.

Answers

Answered by ajinkyabiyani
24

Answer:

#include<iostream>

using namespace std;

int main()

{

 int r,c,i,j;

 int a[10][10];

 int b[10][10];

 cin>>r>>c;

 for(i=0;i<r;i++)

 {

   for(j=0;j<c;j++)

   {

     cin>>a[i][j];

   }

 }

 for(i=0;i<c;i++)

 {

   for(j=0;j<r;j++)

   {

     cout<<a[j][i]<<" ";

   }

   cout<<"\n";

 }

}

ALL CASES SATISFIED

please mark this answers as brain-least

Explanation:

Similar questions