Write a C program to addition of two matrices.
#include<stdio.h> #include<conio.h> main() { int a[10][10],b[10][10],c[10][10],m,n,p,q,i,j; printf("\n Enter the dimension of the 1st matrix"); scanf("%d %d",&m,&n); printf("\n Enter the dimension of the 2nd matrix"); scanf("%d %d",&p,&q); if(m!=p||n!=q) printf("\n Error in input, we can't add.Dimension must be equal."); else { printf("\n Enter the elements of 1st matrix"); for(i=0;i<m;i++) { for(j=0;j<n;j++) scanf("%d",&a[i][j]); } printf("\n Enter the elements 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<n;j++) c[i][j]=a[i][j]+b[i][j]; } printf("\n The result matrix is :\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) printf("%d\t",c[i][j]); printf("\n"); } } getch(); }
Output:
Write a C-Program That Uses Functions To Insert A Sub-String In To A Given Main String From A Given Position.
What is a Judy array?
Write short notes on the following:
Write short note on Call setup of GSM network for mobile-to-mobile call.
What is Weak entity set? Explain with suitable example.
Write a C procram to G.C.D. of two no. using recursion.