View Code of Problem 45

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

Double click to view unformatted code.


Back to problem 45