C++ Bintang

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 19, 2016





anda bisa memasukkan jumlah bintang sesuai keinginan anda, selamat mencoba ya.

 #include <iostream>
using namespace std;
int main ()
{
int n,i,j,k,l;
cout<<"Masukkan Baris Bintang ";
cin>>n;
for (i=1; i<=n; i++) {
for (j=i; j<=n-1; j++)
cout<<"_ ";
for (k=1; k<=i; k++)
cout<<"* ";
for (l=2; l<=i; l++)
//for (l=1; l<=i-1; l++)
cout<<"* ";
cout<<endl;}
return 0;
}


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed