#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
long int a[3][3],b[3][3],r[3][3];
clrscr();
//input for Matrix1
for(i=0;i<=2;i++) //rows
{
for(j=0;j<=2;j++) //col
{
printf("\nEnter
Any
Number
for Matrix1 : ");
scanf("%ld",&a[i][j]);
}
}
//input for Matrix2
for(i=0;i<=2;i++) //rows
{
for(j=0;j<=2;j++) //cols
{
printf("\nEnter
Any Number
for Matrix2 : ");
scanf("%ld",&b[i][j]);
}
}
//for Matrix1
printf("\n Matrix1 : \n");
for(i=0;i<=2;i++) //rows
{
for(j=0;j<=2;j++) //cols
{
printf("
%ld",a[i][j]);
}
printf("\n");
}
//for Matrix2
printf("\n Matrix2 : \n");
for(i=0;i<=2;i++) //rows
{
for(j=0;j<=2;j++) //cols
{
printf("
%ld",b[i][j]);
}
printf("\n");
}
//substraction code
printf("\n
subtraction Matrix:\n");
for(i=0;i<=2;i++) //rows
{
for(j=0;j<=2;j++) //cols
{
r[i][j]=a[i][j]-b[i][j];
printf(" %ld",r[i][j]);
}
printf("\n");
}
getch();
}
|
| Output |
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
2-D ARRAYS SUBSTRACTION
Subscribe to:
Posts (Atom)
Programmingway@Eklavya Technosys!: JTET 2026 | MCQ Questions Syllabus Based
Programmingway@Eklavya Technosys!: JTET 2026 | MCQ Questions Syllabus Based : JTET 2026 | MCQ Questions Based on Syllabus | Information and ...
-
COMPUTER TERMINOLOGY 1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTP...
-
Programmingway@Eklavya Technosys!: PHP Exercise Solutions : PHP Exercise Solutions 1) Fill in the blanks a) The extension of a PHP cod...
-
https://makecode.com/_3VxaMo6c3YPp Code 1) What is Make Code Arcade? Answer: Make Code Arcade is a Block based coding. 2) Writ...
-
Check whether the number is negative or positive after taking a number as input from the user. TextWindow . WriteLine ( "Ente...
-
Programmingway@Eklavya Technosys!: Internet Security : ₪ Internet security Internet security protects your devices, networks, and persona...

No comments:
Post a Comment