C++ Program of Finding Mode of Matrix

Finding Mode of a Matrix

#include<iostream.h>

#include<conio.h>

#include<stdlib.h>

using namespace std;

int main()


{


 cout<<"            <<<<<<< Program for finding the mode of Matrix >>>>>>>"<<endl<<endl;   

 

int a[3][3],b,c,j,i,d,z;


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

 {

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

  {

   cout<<" enter number at location "<<j<<i<<" ====";     

    cin>>a[j][i];

  }

 cout<<"\n";

  }

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

  {

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

   {

   

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

   }

    cout<<"\n";

 }

                                     

z=a[0][0]*(a[1][1]*a[2][2]-a[2][1]*a[1][2])-a[0][1]*(a[1][0]*a[2][2]-a[2][0]*a[1][2])+a[0][2]*(a[1][0]*a[2][1]-a[2][0]*a[1][1]);


cout<<"\n";

cout<<" The mode is ====";


cout<<z<<endl<<"\n";


   

 }                     

                                           <<<<<<<<                                            >>>>>>>

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.

Translate

 
 
.