Search & Find out

Thursday, November 26, 2009

Transpose of two matrix 's

#include "stdio.h"
#include "conio.h"
void main ()
{
    int n[3][3], a[3][3], i, j;
    clrscr ();

    printf("Welcome to transpose of a matrix\n");


    for (i=0;i<3;i++)
    {
        for (j=0;j<3;j++)
        {
            printf ("Enter the value of A[%d %d]: ",i+1,j+1);
            scanf ("%d",&n[i][j]);
        }
    }

    printf("\n\n");
    for (i=0;i<3;i++)
    {
        for (j=0;j<3;j++)
        {
            a[j][i]=n[i][j];
        }
    }
    for (i=0;i<3;i++)
    {
        for (j=0;j<3;j++)
        {
            printf ("%d\t",a[i][j]);
        }
        printf ("\n");
    }
getch ();
}


Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use