Saturday, May 05, 2012

C Program That Print The Shape Of Multiply Sign


Hello guys today i am trying to print the following pattern just see the code and give me your views about this code i try to make this code so simple i am 100% sure that you can easily understand it.

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


 for(i=1;i<=5;i++)
 {

  for(k=1;k<i;k++)
   printf(" ");

  for(j=5;j>=i;j--)
   printf(" *");

  printf("\n");
 }
 for(i=2;i<=5;i++)
 {
  for(k=i;k<=4;k++)
   printf(" ");


  for(j=1;j<=i;j++)
   printf(" *");


   printf("\n");
 }
 getch();
 return(0);
}




************Thanks friends************

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts