Thursday, 21 January 2021

PROGRAM IN C++ TO ADD 2 MATRICES [ DOUBLE DIMENSIONAL ARRAYS ]

 //WAP IN C++ TO ADD 2 MATRICES

#include<iostream>

using namespace std;

main()

{

  int a[10][10],i,j,n;

  cout<<"Enter the Size of the Matrix";

  cin>>n;

  cout<<"Enter the elements of the Matrix"<<endl;

  for(i=0;i<n;i++)

  { 

  for(j=0;j<n;j++)

  cin>>a[i][j];

  }

  cout<<"The Martix:"<<endl;

  for(i=0;i<n;i++)

  {

  for(j=0;j<n;j++)

  {

  cout<<a[i][j]<<" ";

  }

  cout<<endl;

  }

}

No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...