Saturday, May 05, 2012

C Program That Print The Shape Of Kite

Hiiii friends today i am trying to print the follwing pattern,just see the code and give me your views about this code,this code is so simple and you can easily understand it.



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


#include<stdio.h>
#include<conio.h>
int main()
{
 int i,j,k,l;
 clrscr();
 l=1;
 printf("\n HERE IS YOUR PATTERN:\n");
 for(i=1;i<=9;i=i+2)
 {
  for(k=l;k<=4;k++)
   printf("  ");
  for(j=1;j<=i;j++)
   printf(" *");
  printf("\n");
  l++;
 }
 l=1;
 for(i=7;i>=1;i=i-2)
 {
  for(k=1;k<=l;k++)
   printf("  ");
  for(j=1;j<=i;j++)
   printf(" *");
  printf("\n");
  l++;
 }
 l=3;
 for(i=3;i<=5;i=i+2)
 {
  for(k=1;k<=l;k++)
   printf("  ");
  for(j=1;j<=i;j++)
   printf(" *");
  printf("\n");
  l--;
 }
 getch();
 return(0);
}



                         Thanks Guys...........

2 comments:

Please Give Me Your Views

Popular Posts