Hasil Running |
/*PROGRAM SEGITIGA*/
#pragma argsused
#include<conio.h>
#include<iostream.h>
#include<math.h>
int main()
{
int bin, i, j, k;
cout<<"***MEMBUAT BENTUK SEGITIGA***"<<endl;
cout<<"============================="<<endl;
cout<<"Masukkan jumlah Level bintang : "; cin>>bin;
cout<<endl;
for (i=1; i<=bin; i++)
{
for (j=i; j<=bin; j++)
cout<<" ";
for (k=1; k<=i; k++)
cout<<"*"<<" ";
cout<<endl;
}
getch();
}
0 komentar:
Posting Komentar