Skip to main content

Multiplication of Matrix:

#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],j,i,k;
clrscr();
printf("Enter a 3*3 matrix\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Enter a second 3*3 matrix\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&b[i][j]);
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=0;
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
{
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
}
}
printf("Matrix multiplication is-\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d ",c[i][j]);
}
printf("\n");
}
getch();
}

Comments

Popular posts from this blog

Window 7 In Just 9 MB

Hey,,,Welcome to this post.. Now everyone must be thinking that this must be a spam or a fraud but i promise you it is real and fully working window 7.. This is not done by a magic.. We are living in 20,s century and by the help of technology , everything is possible, so without wasting your time,here is the link. Extract it through Winrar and Your window 7 is ready.. Window 7 in 9 mb

To remove duplicate element from an array:

#include<stdio.h> #include<conio.h> void main() { int i,c=10,j,a[10],d=10; clrscr(); printf("Enter ten numbers\n"); for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;i<10;i++) { c: c--; if(a[i]==a[i+1]) { for(j=i;j<10;j++) { a[j]=a[j+1]; } d--; if(c>0) goto c; } } printf("Array after removing duplicate\n"); for(i=0;i<d;i++) printf("%d",a[i]); getch(); }