100 Most Important C# Programs
44. Program to accept two 3 dimensional array and store addition of those into arrays into the third array .
Code:
# include <stdio.h>
# include <conio.h>
main( )
{
int a[3][3],b[3][3],c[3][3],i,j;
clrscr( );
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
printf(“enter the two values for
a[%d][%d] & b[%d][%d]”, i,j,i,j);
scanf(“%d%d”,&a[i][j],&b[i][j]);
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf(“%d”,c[i][j]);
}
printf(“\n”);
}
getch( );
}