Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program in c language for the multiplication of two
matrices using pointers?

Answer Posted / syed fakheruddin ahmad

main()
{
int mat1[3][3] = {1,2,3,4,5,6,7,8,9};
int mat2[3][3] = {1,2,3,4,5,6,7,8,9};
int res[3][3];
int i,j,k;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
res[i][j] = 0;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
for (k=0; k<3; k++)
*(*(res + i) + j) += (*(*(mat1 + i) + k)) * (*(*(mat2 + k)
+ j));

for (i=0; i<3; i++)
{
for (j=0; j<3; j++)
printf ("%d\t", res[i][j]);
printf ("\n");
}
printf("\n");
}

Is This Answer Correct ?    100 Yes 45 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is property type c?

1080


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1915


Why c is procedure oriented?

1068


Explain function?

1086


What is #include called?

1053


the question is that what you have been doing all these periods (one year gap)

2078


i want to know the procedure of qualcomm for getting a job through offcampus

2468


How can I recover the file name given an open stream?

1007


What are volatile variables in c?

938


What is return in c programming?

968


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

2423


How main function is called in c?

1122


main() { printf("hello"); fork(); }

1190


What is && in c programming?

1164


Explain how do you determine the length of a string value that was stored in a variable?

1150