Write a C program to multiplication of two matrix.
#include<stdio.h> #include<conio.h> main() { int a[10][10],b[10][10],c[10][10],m,n,p,q,i,j,k; printf("\n Enter the dimension of 1st matrix"); scanf("%d %d",&m,&n); printf("\n Enter the dimension of 2nd matrix"); scanf("%d %d",&p,&q); if(n==p) { printf("\n the multiplication is possiable."); printf("\n Enter the element of 1st matrix"); for(i=0;i<m;i++) { for(j=0;j<n;j++) scanf("%d",&a[i][j]); } printf("\n Enter the element of 2nd matrix"); for(i=0;i<p;i++) { for(j=0;j<q;j++) scanf("%d",&b[i][j]); } for(i=0;i<m;i++) { for(j=0;j<q;j++) { c[i][j]=0; for(k=0;k<n;k++) c[i][j]=c[i][j]+(a[i][k]*b[k][j]); } } printf("\n The 1st input matrix is\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { printf("\t%d",a[i][j]); } printf("\n"); } printf("\n The 2nd input matrix is\n"); for(i=0;i<p;i++) { for(j=0;j<q;j++) { printf("\t%d",b[i][j]); } printf("\n"); } printf("\n After multiplication the result matrix is\n"); for(i=0;i<m;i++) { for(j=0;j<q;j++) { printf("\t%d",c[i][j]); } printf("\n"); } } else printf("\n The multiplication is not possable"); getch(); }
Output:
What do you mean by co-channel interference and system capacity?
Write a C procram to G.C.D. of two no. using recursion.
What is a minimum spanning tree ? Describe Huffman’s Algorithm.