Technicalsymposium

Join Our Email Alerts-Subscribe
Important Note:Login & Check Your Email Inbox and Activate Confirmation Link


Enter Your Email :

Google Recommended: C Programs & C Programming tutorial Details through Leading Websites-Get Below




C Program For Matrix addition

void main()

{

int r,c,a[10][10],i,j,m,n,b[10][10],z[10][10];

clrscr();

printf("Enter r and c value:");

scanf("%d%d",&r,&c);

for(i=1;i<=r;i++)

{

for(j=1;j<=c;j++)

{

printf("a[%d][%d]=",i,j);

scanf("%d",&a[i][j]);

}

}

for(m=1;m<=r;m++)

{

for(n=1;n<=c;n++)

{

printf("b[%d][%d]=",m,n);

scanf("%d",&b[m][n]);

}

}

// z[i][j]=0;

for(i=1;i<=r;i++)

{

for(j=1;j<=c;j++)

{

z[i][j]=(a[i][j]+b[i][j]);

}

}

for(i=1;i<=r;i++)

{

for(j=1;j<=c;j++)

{

printf("%d\t",z[i][j]);

}

printf("\n");

}

getch();

}


All Programming Codes/Onlie Training/ Lab Manuals Download