Tuesday 27 September 2016

pattern 12

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


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
int Pheight=5;
clrscr();
for(i=1li<=pheight;i++)
{
for(k=pheight-1;k>=1;k--)
{
printf("*");
}
printf("\n");
}

//bottom pyramid
for(i=pheight-1;i>=1;i--)
{
for(k=pheight-1;k>=i;k--)
{
printf("*");
}
printf("\n");
}
getch();
}

No comments:

Post a Comment