(Under Progress)
Showing posts with label Arrays. Show all posts
Showing posts with label Arrays. Show all posts

Program to find sum of individual diagonals of a matrix


#include <iostream.h>
void main()
{
 int A[10][10],i,j,row,col,sd1,sd2l

 // Enter number rows and columns 
cout << "Enter rows and columns:\n";
cin >> row >> col;

Program to find row sum and column sum of a matrix

#include <iostream.h>
void main()
{
 int A[10][10],i,j,r[10],c[10],row,col;

// Input of no of rows and columns
 cout << "Enter no of rows and columns:\n";
 cin >> row >> col;

// Input of matrix
 cout << "Enter matrix elements:\n";
 for( i=0; i<row; i++ )
 { for ( j=0; j<col; j++ )
   cin >> A[i][j];
 }

 

Categories