Sunday, September 22, 2013

C code to generate the following pattern

*
* *
* * *
* * * *
* * * * *

# include
# include
void main( )
{
        int i, j;
        clrscr ( );
        for (i = 0; i < 5; i ++)             // Horizontal Line
        {
                for (j = 0; j < = i; j ++)        // Printable Character
                {
                           printf ("*");
                 }
                printf ("\n");
        }
       getch ( );
}

No comments:

Post a Comment