Question

using c language: create functions that perform the following actions on 2 dimensional arrays (matrices), write...

using c language:

create functions that perform the following actions on 2 dimensional arrays (matrices), write these functions using pointers only (do not use []). Write a function that computes the addition of two arbitrary but same sized matrices. Write a function that computes the matrix determinant. The number of matrix rows and columns must be the same but the function should give the correct answer for any size square matrix.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
void main()
{
int a[10][10],b[10][10],c[10][10],i,j,m,n;
printf("Enter m & n:");
scanf("%d %d",&m,&n);
printf("Enter 1 matrix:");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",(*(a+i)+j));
}
}
printf("\nEnter 2 matrix:");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",(*(b+i)+j));
}
}
printf("\nAddition Matrix:\n");
for(i=0;i<m;i++)
{ for(j=0;j<n;j++)
{
*(*(c+i)+j)=*(*(a+i)+j)+ *(*(b+i)+j);
printf("%d ",*(*(c+i)+j));
}
printf("\n");
}
}

Output:

Add a comment
Know the answer?
Add Answer to:
using c language: create functions that perform the following actions on 2 dimensional arrays (matrices), write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT