Code for pattern 7

Code for pattern 7

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

#include<stdio.h>
#include<conio.h>
void main()
{
    int i,j,k;
    for(i=1;i<=4;i++)
    {
        for(j=3;j>=i;j--)
        {
            printf(" ");
        }
        for(k=1;k<2*i;k++)
        {
            printf("*");
        }
        printf("\n");
    }
    getch();
    }


Output



Comments

Popular posts from this blog

Code for pattern 6

Code to check leap year