Source Code :
#include <iostream.h>
void main(){
int b,j,k ;
cout
<< "----Segitiga Bintang---- \n\n";
cout<<"Masukkan
bilangan = "; cin>>k;
for(b=1;b<=k;b++)
{
for(j=1;j<=k-b;j++){
cout<<"
";
}
for(j=1;j<=b;j++){
cout<<"*";
}
for(j=b-1;j>=1;j--){
cout<<"*";
}
cout<<endl;
}
}
0 komentar:
Posting Komentar