-
Notifications
You must be signed in to change notification settings - Fork 0
/
transpose.c,v
61 lines (55 loc) · 903 Bytes
/
transpose.c,v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
head 1.1;
access;
symbols;
locks
root:1.1; strict;
comment @ * @;
1.1
date 2016.07.26.16.13.13; author root; state Exp;
branches;
next ;
desc
@In this we transpose the matrix
Rows and column is entered by the user
@
1.1
log
@Initial revision
@
text
@#include<stdio.h>
int a17()
{
printf("\t\t____________________TRANSPOSE OF MATRIX____________________\n");
int rows,col,i,j;
printf("Enter the no of rows and column of MATRIX 'A':\n");
scanf("%d%d",&rows,&col);
int a[rows][col];
int b[col][rows];
printf("Enter the elements of MATRIX 'A'\n");
for(i=0;i<rows;i++)
{
for(j=0;j<col;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\t\t_______________TRANSPOSE OF MATRIX 'A'_______________\n");
for(i=0;i<rows;i++)
{
for(j=0;j<col;j++)
{
b[j][i]=a[i][j];
}
}
for(i=0;i<col;i++)
{
for(j=0;j<rows;j++)
{
printf("\t\t%d",b[i][j]);
}
printf("\n");
}
return 0;
}
@