main()
{
printf("\t\t1.Addition of two matrices\n");
printf("\t\t2.Multiplication of two matrices.\n");
printf("\t\t3.Trace of a matrix\n");
printf("\t\t4.Transpose of matrix\n");
int a[10][10],b[10][10],c[10][10],i,j,k,sum=0,m,n,o,p,s;
printf("Select a option from the above list: \t");
scanf("%d",&s);
switch(s)
{
case 1:
printf("\n\t\t=============================>a.Addition of two matrices<==============================================\n"); printf("\n\t ***For the addition Enter the same same size of matrix*** \n"); printf("\nEnter rows and columns of the first matrix:\n"); scanf("%d %d",&m,&n); printf("\nEnter rows and columns of the second matrix:\n"); scanf("%d %d",&o,&p); printf("\nEnter the elements here for first matrix:\n"); for(i=0;i
printf("\nEnter rows and columns of the matrix:\n");
scanf("%d %d",&m,&n);
printf("\nEnter the elements here for first matrix:\n");
for(i=0;i
printf("\nThe real matrix is :\n");
for(i=0;i
printf("\n");
for(j=0;j
printf("%d\t",a[i][j]);
}
}
printf("\n\n");
for(i=0;i
for(i=0;i
for(j=0;j
b[i][j]=a[j][i];
}
}
printf("\nTraspose of matrix is :\n\t");
for(i=0;i
printf("\n");
for(j=0;j
printf("%d\t",b[i][j]);
}
}
printf("\n\n");
break;
default :
printf("\n Choose the right option which is with in the range 1-4 only \n\n");
break;
}
}
No comments:
Post a Comment