Write a program to print half piramid pattern given below

                                                                 

Write a program to print half piramid pattern given below

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

Code Written in Turbo C++ :-

#include<stdio.h>

#include<conio.h>

void main()

{

    int i,j,c=35,r=5,c1;

    clrscr();

    for(i=1;i<=11;i+=2)

    {

        c1=c;

        for(j=1;j<=i;j++)

        {

            gotoxy(c1,r);

            printf("*");

            c1=c1+2;

        }

        r=r+2;

        c=c-2;

    }

    getch();

}

Post a Comment

0 Comments