Advertisement
juliarnasution

pola bintang 3

May 22nd, 2020
1,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int jumlah;
  7.     cout << "Masukkan Jumlah Maksimal Bintang ! ";
  8.     cin>> jumlah;
  9.  
  10.     for(int a=1;a<=jumlah;a++){
  11.         for(int b=1;b<a;b++){
  12.             cout<<" ";
  13.         }
  14.  
  15.         for(int c=jumlah;c >=a;c--){
  16.             cout<<"*";
  17.         }
  18.         cout<<endl;
  19.     }
  20.  
  21.     cin.get();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement