SIMPLE C++ PROGRAM TO PRINT SQUARE MATRIX
{
cout<<k<<"\t";
k++;
}
[[ k is random no. for just printing the random square matrix]]
C++ programm
GREEN CODE IS MAIN PROGRAM
#include<iostream.h>
void main()
{
int i,j,n,k;
k=1;
cout<<"Enter the order of square matrix";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++){
cout<<k<<"\t";
k++;
}
cout<<"\n";
}
}
[[ k is random no. for just printing the random square matrix]]
0 comments:
Post a Comment