![]() |
| O/P |
// SAVE PROGRAM WITH EXTENSION .CPP OR DECLARE ALL VARIABLES
// AT THE BEGIN OF MAIN FUNCTION
#include<graphics.h>
#include<dos.h>
#include<conio.h>
void main()
{
int gd=DETECT, gm;
initgraph(&gd, &gm, "c:\\turboc3\\bgi");
int x = getmaxx();
int y = getmaxy();
int rad=0;
setbkcolor(WHITE);
setcolor(RED);
settextstyle(7, 0, 5);
outtextxy(x/2-80,50,"Rainbow");
for(int i=0; i<15; i++)
{
setcolor(i);
for(int j=0; j<20; j++)
{
arc(x/2, y, 0, 180, rad++);
}
delay(50);
}
getch();
closegraph();
}

No comments:
Post a Comment