Showing posts with label circle in c. Show all posts
Showing posts with label circle in c. Show all posts

Monday, April 5, 2021

, , , , ,

Arc function in C with graphics in c

 Declaration: void arc(int x, int y, int stangle, int endangle, int radius);

"arc" operate is employed to draw associate arc with center (x, y) for example draw a corcle in c programming and stangle specifies beginning angle for arc, end angle for arc can be define by endangle and the and last parameter specifies the radius of the arc.

 arc operate may also be accustomed draw a circle except for that beginning angle and finish angle ought to be zero and 360 severally.

Draw A circle in c programming 

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

int main()
{
   int gd = DETECT, gm;

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

   arc(100, 100, 0, 135, 50);
   
   getch();
   closegraph();
   return 0;
}



Well in the written c program for circle in c which is having (100,100) center '0' is the starting angle, 135 is the end angle and '50' is an radious.