#include
#include
int main()
{
int ganjil;
do
{
cout<<"Masukkan bilangan ganjil (1-19): ";
cin>>ganjil;
}while(ganjil%2==0);
for(int i=0; i<=ganjil; i+=2)
{
for(int j=0; j
{
cout<<" ";
}
for(int z=0;z<=i;z++)
{
cout<<"*";
}
cout<
}
ganjil = ganjil - 2;
for(int i=0; i{
for(int j=0; j<=i+2;j+=2)
{
cout<<" ";
}
for(int z=1;z<=ganjil-i;z++)
{
cout<<"*";
}
cout<
}
getch();
return 0;
}
Home »Unlabelled » Membuat Program Diamond dalam C++
Membuat Program Diamond dalam C++
Posted by
Adhit
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment