0% found this document useful (0 votes)
39 views3 pages

PROGRAME19

This C++ program subtracts two 2-D arrays. It takes user input to populate two 3x3 arrays, then calculates the subtraction of corresponding elements and stores the results in a third 3x3 array. The output displays the result array.

Uploaded by

harry221992
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

PROGRAME19

This C++ program subtracts two 2-D arrays. It takes user input to populate two 3x3 arrays, then calculates the subtraction of corresponding elements and stores the results in a third 3x3 array. The output displays the result array.

Uploaded by

harry221992
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PROGRAME-19

TASK-WAP to subtract two 2-D arrays

PURPOSE- By implementing this program we are capable to find out


subtraction of two 2-D arrays.

#include<iostream.h>

#include<conio.h>

int main()

int a1[3][3],a2[3][3],i,j,result[3][3];

cout<<"enter value in first array:";

for(i=0;i<=2;i++)

for(j=0;j<=2;j++)

cin>>a1[i][j];

cout<<"enter value in second array:";

for(i=0;i<=2;i++)

for(j=0;j<=2;j++)

{
cin>>a2[i][j];

cout<<"result is :";

for(i=0;i<=2;i++)

for(j=0;j<=2;j++)

result[i][j]=a1[i][j]-a2[i][j];

cout<<result[i][j]<<endl;

getch();

}
OUTPUT-

You might also like