Search & Find out

Sunday, December 6, 2009

pyramids by asterix symbols

#include "stdio.h"
#include "conio.h"

void main()
{
  int a,b,c,d,n,m,x,y;
  clrscr();
  printf("Welcome to Astrick Phyramid\n\n");
  printf("Enter a number  ");
  scanf("%d",&n);

   m=n-1;
   d=1;

   for(a=1; a<=n; a++)
   {
     for(b=1; b<=m; b++)
     {
       printf("   ");
     }

     for(c=1; c<=d; c++)
     {
       printf("*  ");
     }

     printf("\n\n");
     m--;
     d+=2;
   }

     getch();
 }



Get the executable ( .exe ) file for this program..
Download

0 comments:

Post a Comment

 

My Blog List

Term of Use