0% found this document useful (0 votes)
5 views2 pages

Experiment 10

The document outlines a programming experiment for computing the product of two matrices in C. It includes the code for taking user input for the dimensions and elements of the matrices, as well as displaying the resultant matrix. The document also contains student identification details.

Uploaded by

shahbanahmad0147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Experiment 10

The document outlines a programming experiment for computing the product of two matrices in C. It includes the code for taking user input for the dimensions and elements of the matrices, as well as displaying the resultant matrix. The document also contains student identification details.

Uploaded by

shahbanahmad0147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SIET, Jhalwa Prayagraj

Department of Computer Science & Engg.

EXPERIMENT NO- 10

Object: WAP to take input of two matrices and print their product.

Program:
#include<stdio.h>

#include<conio.h>

void main(){

int mat1[10][10],mat2[10][10],i,j,dim11,dim12,dim21,dim22;

clrscr();

printf("Enter the dimensions of matrix 1: ");

scanf("%d %d",&dim11,&dim12);

printf("Enter the dimensions of matrix 2: ");

scanf("%d %d",&dim21,&dim22);

printf("Enter the elements of matrix 1: \n");

for(i = 0; i<dim11; i++){

printf("Elements of row %d: ",i+1);

for(j = 0; j<dim12; j++){

scanf("%d",&mat1[i][j]);

printf("Enter the elements of matrix 2: \n");

for(i = 0; i<dim21; i++){

printf("Elements of row %d: ",i+1);

for(j = 0; j<dim22; j++){

Page 1 of 2
scanf("%d",&mat2[i][j]);

printf("The resultant matrix is: \n");

for(i = 0; i<dim11; i++){

for(j = 0; j<dim12; j++){

mat1[i][j] = mat1[i][j] * mat2[j][i];

printf("%d ",mat1[i][j]);

printf("\n");

getch();

Output:

Name: Suraj Singh

Year: 2nd

Uni. Roll No.: 2301620100162

Section: CS3

Branch: Computer Science and Engg.

Page 2 of 2

You might also like