Tuesday, 20 December 2011

Reverse Floyds Triangle

7 8 9 10
4 5 6
2 3
1


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
i=7;
for(j=3;j>=0;j--)
{
for(k=0;k<=j;k++)
{
printf("%d ",(i+k));
}
i=i-j;
printf("\n");
}
getch();
}

No comments:

Post a Comment