IT Branch

Transpose and diagonal sum of a Matrix- C Program

#include<stdio.h>
int main()
{
  int a[10][10],b[10][10],i,c,j,k=0,m,n,sum=0;
  printf("\nenter your choice");
  printf("\n1.Transpose\n2.Diagonal sum\n");
  scanf("%d",&c);
  printf("\nEnter the row and column of matrix: \n");
  scanf("%d %d",&m,&n);
 
  printf("\nEnter the elements of matrix->");
  for(i=0;i<m;i++)
  {
      for(j=0;j<n;j++)
      {
           scanf("%d",&a[i][j]);
      }
  }
  printf("\nThe matrix is\n");

Pages