This is a simle program to learn the functionality of CIRCLE function
Declaration :- void circle(int x, int y, int radius);
Circle function is used to draw a circle with center (x,y) and third parameter specifies the radius of the circle. The code given below draws a circle.
#include <graphics.h>
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "C:\\TC\\bgi"); /* Graphics Initialisation*/
/* draw the circle */
circle(200, 200, 50);
/* clean up */
getch();
closegraph();
return 0;
}
In the above program (200, 200) are coordinates of center of the circle and 50 is the radius of circle.
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "C:\\TC\\bgi"); /* Graphics Initialisation*/
/* draw the circle */
circle(200, 200, 50);
/* clean up */
getch();
closegraph();
return 0;
}
In the above program (200, 200) are coordinates of center of the circle and 50 is the radius of circle.
Please LIKE & SHARE US if helpful!
0 comments:
Post a Comment