View Code of Problem 45

#include<stdio.h>
int main()
{
	
	int i,j,n,e,k;
	int a[10][10],b[10][10];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
		  scanf("%d",&a[i][j]);
		}
	}

	for(e=0;e<n;e++)
	{
		for(k=0;k<n;k++)
		{
			b[e][k]=a[k][e];
			if((a[k][e])!='\0')
		      printf("%d ",b[e][k]);
			else
			  printf("%d",b[e][k]);

		}
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 45