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

Who developed c language?

1042


What is the use of pragma in embedded c?

1005


Is void a keyword in c?

927


Why is c so important?

998


What is the use of gets and puts?

976


Why can’t constant values be used to define an array’s initial size?

1328


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4242


Do string constants represent numerical values?

1326


Is c procedural or object oriented?

956


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1174


Is c weakly typed?

972


Which is best linux os?

974


How can I convert a number to a string?

1098


Explain what is the concatenation operator?

1111


What is a macro in c preprocessor?

1056