Sunday, May 30, 2010

membuat segitiga bintang dengan C++

#include
#include
void main()
{
int n;
int baris;
int kolom;
cout<<"inputkan jumlah bintang : ";
cin>>n;
cout<
cout<<"segitiga atas"<
cout<<"-------------"<
for(baris=1; baris<=n; baris++)
{
for(kolom=1; kolom<=baris; kolom++)
cout<<"*";
cout<
}
getch();
}

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Laundry Detergent Coupons