/* Write A C Program To Find Accept A Matric

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View /* Write A C Program To Find Accept A Matric as PDF for free.

More details

  • Words: 222
  • Pages: 2
/* Write a C program to find accept a matric of order M x N and find * the sum of the main diagonal and off diagonal elements

* */

#include <stdio.h> void main () { static int ma[10][10]; int i,j,m,n,a=0,sum=0; printf ("Enetr the order of the matix \n"); scanf ("%d %d",&m,&n); if ( m == n ) { printf ("Enter the co-efficients of the matrix\n"); for (i=0;i<m;++i) { for (j=0;j
printf ("The givan order is not square matrix\n"); /* End of main() */

/*-------------------------------------------------------Output Enetr the order of the matix 3 3 Enter the co-efficients of the matrix 1 2 3 4 5 6 7 8 9 The given matrix is 1 2 3

4 5 6 7 8 9 The sum of the main diagonal elements is = 15 The sum of the off diagonal elemets is = 15 Run 2 Enetr the order of the matix 2 3 The givan order is not square matrix --------------------------------------------------------*/

Related Documents