Entering VaLUES INTO 2D matrix

0 comments
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:

0 comments:

Post a Comment

Copyright 2011 Programming In C++.
Blogger Template by lordhtml / Free Blogger Template