identita.cpp

Bookmark and Share
#include<iostream.h>

main()

{

int n,i,j;

cout<<"Matriks identitas n x n";

cout<<"\nMasukkan n : ";

cin>>n;

cout<<"Matriks identitas "<<n<<" x "<<n<<" adalah"<<endl;

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



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



{if (i==j)

cout<<1;

else

cout<<0;



cout<<"\t";}



cout<<endl;}

}



{ 0 komentar... Views All / Send Comment! }

Posting Komentar

Powered By Blogger