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

Explain what is the benefit of using enum to declare a constant?

1047


write a c program for swapping two strings using pointer

2590


Which function in C can be used to append a string to another string?

1187


What are static variables in c?

1047


write a proram to reverse the string using switch case?

2905


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1925


Explain what happens if you free a pointer twice?

1043


What is pointers in c?

1081


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2294


How can I write a function that takes a format string and a variable number of arguments?

1014


What is a built-in function in C?

1551


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5584


Explain a file operation in C with an example.

1073


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1228


Why c language?

1024