annasgtg

setengahPiramid

Feb 12th, 2018
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<iostream>
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.     int i, j, k;
  9.     cout<<"Masukkan Jumlah Baris: ";
  10.     cin>>k;
  11.     for(i=0; i<k; i++)
  12.     {
  13.         for(j=0; j<=i; j++)
  14.         {
  15.             printf("* ");
  16.         }
  17.         printf("\n");
  18.     }
  19.     getch();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment