arc function in C
The header file graphics.h contains arc() function which draws an arc with center at (x, y) and given radius. start_angle is the starting point of angle and end_angle is the ending point of the angle. The value of the angle can vary from 0 to 360 degree.
Syntax :
void arc(int x, int y, int start_angle,
int end_angle, int radius);
where,
(x, y) is the center of the arc.
start_angle is the starting angle and
end_angle is the ending angle.
'radius' is the Radius of the arc.
Examples :
Input : x=250, y=250, start_angle = 155, end_angle = 300, radius = 100 Output :Input : x=250, y=250, start_angle = 0, end_angle = 300, radius = 100; Output :
![]()
Below is the implementation of arc() function :
// C implementation of arc function #include <graphics.h> // driver code int main() { // gm is Graphics mode which is // a computer display mode that // generates image using pixels. // DETECT is a macro defined in // "graphics.h" header file int gd = DETECT, gm; // location of the arc int x = 250; int y = 250; // starting angle and ending angle // of the arc int start_angle = 155; int end_angle = 300; // radius of the arc int radius = 100; // initgraph initializes the graphics system // by loading a graphics driver from disk initgraph(&gd;, &gm;, ""); // arc function arc(x, y, start_angle, end_angle, radius); getch(); // closegraph function closes the graphics // mode and deallocates all memory allocated // by graphics system closegraph(); return 0; } |
chevron_right
filter_none
Output:
Recommended Posts:
- putwchar() function in C/C++
- strlwr() function in C
- iswupper() function in C/C++
- vswscanf() Function in C/C++
- vwprintf() function in C/C++
- fegetenv() function in C/C++
- fegetexceptflag() function in C/C++
- wcstol() function in C/C++
- wmemchr() function in C/C++
- wcrtomb() function in C/C++
- vswprintf() function in C/C++
- wmemcmp() function in C/C++
- wcstoul() function in C/C++
- wctrans() function in C/C++
- clock() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Kirti_Mangal





Input : x=250, y=250, start_angle = 0, end_angle = 300, radius = 100;
Output :