The BOTTOM LINE Quote Of The Day

The BOTTOM LINE Quote Of The Day

Don't Ever Tell GOD How BIG Your Problems are.
Just Tell Your Problems How BIG your GOD is ;)

Wednesday, January 12, 2011

Pyramid Of Number - 2

#include<stdio.h>
#include<conio.h>


 void main()
   {
       int num,i,j,k,l,x=1;
       X: clrscr();
       printf("\n\n Enter the number of level u wanna print in this pyramind (Max. 33):");
       scanf("%d",&num);
if(num>33)
{ goto X; }
       printf("\n\n The Following Pyramind is : \n\n");
for(i=1;i<=num;i++)
   {
    k = num-i;
    for(j=1;j<=k;j++)
{ printf(" "); }
    for(l=1;l<=i;l++)
{
printf("%d ",x%2);
x++;
}
    for(j=1;j<=k+2;j++)
{ printf(" "); }
    printf(" LEVEL:%d \n",k+1);
   }
     getch();
   }

No comments:

Post a Comment