Advertisement
JonathanA007

Jonathan Arya Priguna/Tugas 6 Soal 1

Nov 11th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n;
  6. cout<<"Masukkan Nilai N = "<<endl;
  7. cin>>n;
  8.  
  9. for(int i=1; i<=n; i++){
  10.     for(int k=n-i; k>0; k--)
  11.     cout<<" ";
  12.     for(int l=1; l<=i; l++)
  13.     cout<<"* ";
  14.     cout<<endl;
  15.     }
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement