Completely Solved C, C++ Programs Assignment.




C Program to accept two 3 dimensional array and store subtraction of those two arrays into third array

Filed Under:

Problem 86.C Program to accept two 3 dimensional array and store subtraction of those two arrays into third array.
#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 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( );
}

C compiler: gcc 4.1.2

 Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments