annasgtg

fullPiramid

Feb 12th, 2018
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include<conio.h>
  3. int main()
  4. {
  5.     int i, spasi, baris, k=0;
  6.     printf("Masukkan jumlah baris : ");
  7.     scanf("%d",&baris);
  8.     for(i=1; i<=baris; i++)
  9.     {
  10.     for(spasi=1; spasi<=(baris-i); spasi++)
  11.     {
  12.        printf("  ");
  13.     }
  14.     while(k!=(2*i-1))
  15.     {
  16.        printf("* ");
  17.        k++;
  18.     }
  19.     k=0;
  20.     printf("\n");
  21.     }
  22.     getch();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment