Friday, May 04, 2012

C Program That Print The V Shape

Hello guys today i am sharing an interesting program to all of you just read the code and  tell me what you think after read it..

In this program i am printing the following pattern.


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

#include<stdio.h>
#include<conio.h>
int main()
{
 int i,j,k;
 clrscr();
 printf("\n HERE IS YOUR BEAUTIFUL PATTERN:\n\n\n");
 for(i=1;i<=5;i=i+2)
 {
  for(j=1;j<=i;j++)
   printf(" *");
  for(k=i;k<5;k++)
   printf("  ");

   printf("  ");
  for(k=i;k<5;k++)
   printf("  ");
  for(j=1;j<=i;j++)
   printf(" *");
  printf("\n");
 }
 for(i=1;i<=11;i++)
  printf(" *");
 getch();
 return(0);
}




Thanks Friends.......

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts