View Code of Problem 45

#include<stdio.h>
#include<string.h>
int main()
{
	int a;
	scanf("%d",&a);
	int b[a][a];
	for(int i=0;i<a;i++){
		for(int j=0;j<a;j++)
		scanf("%d",&b[i][j]);
		
	} 
	for(int i=0;i<a;i++){
		for(int j=0;j<a;j++)
  		if(j==a-1)printf("%d",b[j][i]);
        else printf("%d ",b[j][i]);
		printf("\n");
	} 
}
 

Double click to view unformatted code.


Back to problem 45