This website is designed to provide you all codes of C and C++ language and also tutorials for learn the concept of these languages.
Saturday, 4 August 2012
To print Floyd’s triangle in C language
void main()
{
int i,j,num;
int k=1;
printf("Enter the value of range == ");
scanf("%d",&num);
printf("FLOYD's Triangle\n");
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++,k++)
{
printf(" %d",k);
}
printf("\n");
}
getche();
}
No comments:
Post a Comment