Advertisement
hamaXD

Pyramid

Sep 27th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int num;
  5.         printf("Enter num :");
  6.         scanf("%d",&num);
  7.         int row,colSpace,colStar;
  8.         for(row=1;row<=num;row++)
  9.         {
  10.             for(colSpace=num-row;colSpace>=1;colSpace--)
  11.             {
  12.                 printf(" ");
  13.             }
  14.             for(colStar=1;colStar<=(row*2)-1;colStar++)
  15.             {
  16.                 printf("*");
  17.             }
  18.             printf("\n");
  19.         }
  20.        
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement