Toran (Garland) in C prog.











#include <stdio.h>
#include <conio.h>
void main()
{
 int i=9,j=0,k=1,sp=1;
 int ch=1;
 clrscr();
 for(;i>=1;i--)
   {   

     for(j=0;j<=i-1;j++,ch++)
       printf("%d",ch);
if(i!=9)
{
   for(k=1;k<=sp;k++)
printf(" ");
sp=sp+2;
 }


 if(i==9)
  {
   j--;
    ch--;
   }
  for(ch--;ch>=1;ch--)
   printf("%d",ch);
 printf("\n");
 ch=1;
 }
getch();
 }

No comments:

Post a Comment

Thanks for visiting my Blog!

Have a Question ? Need Help in College Assignments, Need Code that is not available here? Just leave a comment & get your code instantly.

Tips to Enhance Your Blog