#include<stdio.h> #include<conio.h> void main() { int i,j; int A[3][4],B[3][4]; clrscr(); for(i=0;i<3;i++) for(j=0;j<4;j++){ printf("Enter the value for A%d%d: ",i+1,j+1); scanf("%d",&A[i][j]);} printf("\nThe given matrix is:\n"); for(i=0;i<3;i++){ for(j=0;j<4;j++) printf("%3d ",A[i][j]); printf("\n");} for(i=0;i<4;i++) for(j=0;j<3;j++) B[i][j]=A[j][i]; printf("\nThe transpose matrix is:\n"); for(i=0;i<4;i++){ for(j=0;j<3;j++) printf("%3d ",B[i][j]); printf("\n");} getch(); }
WHAT'S NEW?
Loading...
Thanks a lot.. nice program for beginners.
ReplyDeleteHere is another program to find transpose of a matrix and sum of matrix and multiply two matrix.
Delete