Sunday, 2 September 2012

Entering VaLUES INTO 2D matrix

For evaluating 2D Matrix first you will require to learn how to enter elements into a 2D Matrix
and then display the matrix.







Heres the code for you. 


#include<iostream.h>
#include<conio.h>
void main()
{   clrscr();
int a[3][3];
int i,j,k;

cout<<"Entered Elements into 3*3 matrix \n";
for(i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>a[i][j];

cout<<"Matrix Entered By you is \n";
for(i=0;i<3;i++)
{for(j=0;j<3;j++)
  cout<<a[i][j]<<" ";
   cout<<endl;
}


getch();

}

OUTPUT:

No comments:

Post a Comment