View Code of Problem 45

#include <stdio.h>
int main(){
	int n,i,j;
	scanf("%d",&n); 
	int a[n][n],b[n][n];
	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			b[j][i]=a[i][j];
/*
Main.c: In function 'main':
Main.c:11:4: error: expected declaration or statement at end of input
    b[j][i]=a[i][j];
    ^
Main.c:5:14: warning: variable 'b' set but not used [-Wunused-but-set-variable]
  int a[n][n],b[n][n];
              ^
*/

Double click to view unformatted code.


Back to problem 45