c-record - 7) multi dimensional array with matrix

 #include<stdio.h>

#include<conio.h>

#include<stdlib.h>  

void main()

{  

int a[10][10],b[10][10],mul[10][10],r,c,i,j,k;    

clrscr();  

printf("enter the number of row=");    

scanf("%d",&r);    

printf("enter the number of column=");    

scanf("%d",&c);    

printf("enter the first matrix element=\n");    

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

{    

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

{    

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

}    

}    

printf("enter the second matrix element=\n");    

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

{    

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

{    

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

}    

}    

printf("multiply of the matrix=\n");    

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

{    

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

{    

mul[i][j]=0;    

for(k=0;k<c;k++)    

{    

mul[i][j]+=a[i][k]*b[k][j];    

}    

}    

}    

//for printing result    

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

{    

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

{    

printf("%d\t",mul[i][j]);    

}    

printf("\n");    

}    

getch();  

}  

note:- write two outputs

1) output:- 3 x 3 matrix

alt  +f9   ------   run and

ctrl+f9   ------  compile










note:- 2 x 2 matrix

2) output:-

alt  +f9   ------   run and

ctrl+f9   ------  compile



Comments

Popular posts from this blog

digital marketing ppt-u1

SOFTWARE

cn lab

Computer Operations and Performing - D L Unit-1-1

DS-Record-mca-04) write a program for evaluating a given postfix expression using stack.

DBMS Degree Lab Records

Unit 2: Foundations of Ownership, Security Related Concepts in Blockchain

Unit-1 Foundations of Software Systems and Blockchain

Access the Internet to Browse Infromation & E-Mail Operation- D L Unit-2-1

6)what are the various service of internet and protocols ICT-unit-1