C Program to Find Transpose of a matrix

Leave a Comment

# include

int i, j;
int value;
int mat[10][10];
void display(int, int);
void display_o( int transp[10][10],int, int);
void input( int transp[10][10],int, int);
void transpose( int transp[10][10],int, int);

void transpose(int transp[10][10], int row, int col)
{
	for(i = 0; i< row; i++)
	{
		for(j = 0; j < col; j++)
		{
			mat[i][j] = transp[j][i] ;
		}
	}
}

void display(int row, int col)
{
	for(i = 0; i < row; i++)
	{
		for(j = 0; j < col; j++)
		{
			printf("  %d", mat[i][j]);
		}
		printf("\n");
	}
}

void display_o(int transp[10][10], int row, int col)
{
	for(i = 0; i < row; i++)
	{
		for(j = 0; j < col; j++)
		{
			printf("  %d", transp[i][j]);
		}
		printf("\n");
	}
}

void input(int transp[10][10], int row, int col)
{
	for(i = 0 ; i< row; i++)
	{
		for(j = 0 ;  j

0 comments:

Post a Comment