by Dinesh Thakur

 

#include <stdio.h>

void main ( )
{
    int a[3][3],b[3][3],i,j,k;
    clrscr();
    printf("Enter Element for 3 x 3 Matrix\n");
    printf("Enter no. : ");
    for(i=0;i<3;i++)
        {
            for(j=0;j<3;j++)
                {    
                   scanf("%d",&a[i][j]);
                }
        }
           printf("\n");
           for(i=0;i<3;i++)
               {
                 for(j=0;j<3;j++)
                     {
                        printf("%d",a[i][j]);
                        printf(" ");
                     }
                        printf("\n");
               }
                        for(i=0;i<3;i++)
                            {
                                 for(j=0;j<3;j++)
                                    {
                                        b[i][j]=a[j][i];
                                    }
                             }
                                  printf("\nThe Transpose is :\n");
                                  printf("\n");
                                  for(i=0;i<3;i++)
                                      {
                                          for(j=0;j<3;j++)
                                               {
                                                   printf("%d",b[i][j]);
                                                   printf(" ");
                                               }
                                                   printf("\n");
                                      }
                                                   getch();
}

Transpose of a Matrix





About Us

Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request Find Dinesh Thakur on
linkedin FaceBook Twitter Google Plus