Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Mathematics ProgramRSS Feeds

Program of matrix multiplication using pointers

Posted By: Adelaide Fischer     Category: C Programming     Views: 13606

Write a program of matrix multiplication using pointers.

Code for Program of matrix multiplication using pointers in C Programming

#include<stdio.h>
#include<conio.h>

void read_arr(int *a,int row,int col)
{
    int i,j;
    for(i=1;i<=row;i++)
    {
    for(j=1;j<=col;j++)
    {
        printf("Enter Element %d %d : ",i,j);
        scanf("%d",((a+i)+j));
            }
    }
}

/* void add_arr(int *m1,int *m2,int *m3,int row,int col)
{
int i,j;
for(i=1;i<=row;i++)
{
for(j=1;j<=col;j++)
{
m3[i][j] = (m1[i][j] + m2[i][j]);
}
}
}

void print_arr(int m[10][10],int row,int col)
{
int i,j;
for(i=1;i<=row;i++)
{
for(j=1;j<=col;j++)
{
printf("%d ",m[i][j]);
}
printf("\n");
}
} */
main() { int m1[10][10],m2[10][10],m3[10][10],row,col; clrscr(); printf("Enter number of rows :"); scanf("%d",&row); printf("Enter number of colomns :"); scanf("%d",&col); read_arr(m1,row,col); /* read_arr(m2,row,col);
add_arr(m1,m2,m3,row,col);
print_arr(m3,row,col);*/
getch(); }
  
Share: 


Didn't find what you were looking for? Find more on Program of matrix multiplication using pointers Or get search suggestion and latest updates.

Adelaide Fischer
Adelaide Fischer author of Program of matrix multiplication using pointers is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!