Search This Blog

Loading...

Circle Function - Computer Graphics CG Program

Statement: void circle (int x,int y,int radius);

Circle function is used to draw a circle with center (x, y) and the third parameter is the radius of the circle. The following code draws a circle.

In the following program (100, 100), the coordinates of the circle center and 50 is the radius of the circle.

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

main() {
   int gd = DETECT, gm;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   circle(100, 100, 50);

   getch();

   closegraph();

   return 0;
}

No comments:

Post a Comment