OCJP

Triangle Of Digits

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=1;i<=10;i++)
{
	for(j=10;j>=i;j--)
	 printf("  ");

       for(j=1;j<=i;j++)
       printf(" %d",j);

       for(j=i-1;j>=1;j--)
       printf(" %d",j);

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

Leave a Reply

Your email address will not be published. Required fields are marked *


× How can I help you?