[ create a new paste ] login | about

Link: http://codepad.org/gicD3WyG    [ raw code | output | fork ]

C, pasted on Oct 24:
#include<stdio.h>
void main()
{
int r,c,n=0;

for(r=1; r<=5; r++)
{
    for(c=n;c>0;c--)
    {
    printf(" ");
    
    }
    printf("$");
    for(c=1; c<=5;c++)
    {
        if((6-r)<=c)
        {
            printf(" ");
        }
        else
        {
            printf("*");
        }
    }
    
    printf("\n");
    n++;

}
printf ("Press any key to continue!");
}


Output:
1
2
3
4
5
6
$**** 
 $***  
  $**   
   $*    
    $     
Press any key to continue!


Create a new paste based on this one


Comments: