Results 1 to 2 of 2

Thread: C code for addition of two matrices (3*3)

  1. #1
    DavisMartin is offline Senior Member
    Join Date
    Dec 2009
    Posts
    174
    Rep Power
    3

    Default C code for addition of two matrices (3*3)

    Hi. I am new in C programming world. I have practice lots of different C program. I try to write a C code for addition of two matrices (3*3). But I am not able to success. If you have any knowledge about the addition of two matrixes, then please try to share with me.

  2. #2
    PerryCollins is offline Senior Member
    Join Date
    Dec 2009
    Posts
    380
    Rep Power
    3

    Default

    I suggest you to refer following example, which will give you something, idea about the use of this:

    Code:
    :#include<stdio.h>
    void main()
    {
    int a[3][3],b[3][3],c[3][3],i,j;
    printf("enter the elements of 1st 3*3 matrix");
    for(i=0;i<3;i++)
    {
    for(j=0;j<3;j++)
    {
    scanf("%d",a[i][j]);
    }
    }
    printf("enter the elements of 1st 3*3 matrix");
    for(i=0;i<3;i++)
    {
    for(j=0;j<3;j++)
    {
    scanf("%d",b[i][j]);
    }
    }
    printf("the sum matrix is");
    for(i=0;i<3;i++)
    {
    for(j=0;j<3;j++)
    {
    c[i][j]=a[i][j]+b[i][j];
    printf("%d",c[i][j]);
    }
    }
    }

Similar Threads

  1. C code for multiplication of two matrices
    By Dianne Belmont in forum Programming
    Replies: 0
    Last Post: 07-30-2010, 09:06 PM
  2. Can't install AOE 3 addition
    By RogersNguyen in forum Gaming Accessories
    Replies: 2
    Last Post: 07-10-2010, 12:36 PM
  3. 60% of profits in addition to Microsoft
    By Logan John in forum Latest Hardware News
    Replies: 0
    Last Post: 01-30-2010, 07:41 AM
  4. AntiVir Personal 8.2.00.337 Addition
    By Damon in forum Download Tools and Softwares
    Replies: 0
    Last Post: 01-28-2009, 03:39 PM
  5. New addition to Gutsy
    By uncosto46 in forum Linux/Free BSD
    Replies: 0
    Last Post: 07-29-2008, 10:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48