(Under Progress)

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];
 }

Program to find the square of the larger number using a function (Return by reference method)

#include <iostream.h>

int main()
{
 int num1, num2, x;
 int sqlarge( int &, int& );      // Function prototype declared
 cout << "Enter two numbers:\n";
 cin >> num1 >> num2;
 x = sqlarge( num1, num2 );       // Function call
 

Categories