Advertisement
Guest User

pyramid

a guest
Jul 15th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     const int max = 3 ;
  6.  
  7.     for(int i = 0 ; i < max ; i++)
  8.     {
  9.         for(int j = 0 ; j < max - i ; j++)
  10.         {
  11.             printf(" ") ;
  12.         }
  13.  
  14.         for(int j = 0 ; j < ((i * 2) + 1) ; j++)
  15.         {
  16.             printf("*") ;
  17.         }
  18.  
  19.         printf("\n") ;
  20.     }
  21.  
  22.     return 0 ;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement