#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,s=0;
int a[3][3],b[3][3],r[3][3];
clrscr();
//input1
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf("\n\tEnter Elements
For Matrix1 ");
scanf("%d",&a[i][j]);
}
}
//input2
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf("\n\tEnter Elements
For Matrix2 ");
scanf("%d",&b[i][j]);
}
}
//mult logic
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
for(k=0;k<=2;k++)
{
s=s+a[i][k]*b[k][j];
}
r[i][j]=s;
s=0;
}
}
//output1
printf("\n\tMatrix1 :
\n\t");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d",a[i][j]);
}
printf("\n\t");
}
//output
printf("\n\tMatrix2 :
\n\t");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d",b[i][j]);
}
printf("\n\t");
}
//output3
printf("\n\tMultiplication :\n\t");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d",r[i][j]);
}
printf("\n\t");
}
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 MULTIPLICATION
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