Printing Floyd's, Triangle in C with Colorful output


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
clrscr();
int n=0;
for(int a=0;a<=5;a++)
{
for(int b=1;b<=a;b++)
{
textcolor(b+1);
n++;
cprintf("%d ",n);
}
printf("\n");
}
getch();

                                         Output

1 comment:

Program:- #include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int a=2; clrscr(); ...

GET UP TO 70% OFF