Monday 6 August 2012

Write a program using c to print the pattern.

/* Write a c program to print the following structure :
    *
    **
    ***
    ****
    *****
 */
 #include<stdio.h>
 int main()
 {
 int i,j;
  for(i=1;i<=5;i++)
    {
     printf("\n");
        for(j=0;j<i;j++)
          {
            printf("*");
            }
    }
  }

No comments:

Post a Comment