arc() Function

arc() function is used to draw an arc with a center (X,Y) on the screen.

void arc(int x, int y, int stangle, int endangle, int radius);
  • arc() function contains five parameter that are X-coordinate, Y coordinate, start angle, end angle and radius of the arc.
  • One can also draw a circle by using arc function. For this start angle must be 0 and end angle must be 360.





void main()


int gd=DETECT,gm;

initgraph(&gd,&gm," ");





The above program is used to draw the arc of radius 100,with start angle and end angle 0 and 45 degree respectively at position (320,240) on the screen. We can also draw a circle from arc function by taking start angle 0 and end angle 360 degree.