1.write A Program To Draw A Circle in Graphics With C++

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

1.Write a program to draw a circle in graphics with c++.

#include<graphics.h> #include<conio.h> #include<dos.h> void main() { int a=DETECT,b; int red=RED,blue=BLUE; initgraph(&a,&b,"c:\\turboc3\\bgi"); int x=100,y=200; while(1) { red=red+blue; blue=red-blue; red=red-blue; circle(x,y,70); setfillstyle(SOLID_FILL,red); floodfill(x,y,WHITE); circle(x+300,y,70); setfillstyle(SOLID_FILL,blue); floodfill(x+300,y,WHITE); delay(500); if(kbhit()) { char ch=getch();

if(ch==27) { closegraph(); return; } } }

You might also like