TEAM CODING-BCA

C Program for Displaying Rainbow

C Program for Displaying Rainbow :

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>

void main()
{
int x,y,i;
int gd,gm;
detectgraph(&gd,&gm);

initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
x=getmaxx()/2;
y=getmaxy()/2;
I
for(i=30,i<170;i++)
{
delay(70);
setcolor(i/10);
arc(x,y,0,180,i-10);
}
getch();
closegraph();
}

Output

No comments:

Post a Comment