Sunday, 8 January 2012

floyd's triangle


#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c=1,d;
clrscr();
printf("enter a number");
scanf("%d",&d);
for(a=1;a<=d;a++)
{
printf("\n");
for(b=1;b<=a;b++)

printf("%d",c++);

printf("\n");
}


getch();
return 0;
}

No comments:

Post a Comment