View Code of Problem 45

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

Double click to view unformatted code.


Back to problem 45