C program to draw arc from 135 to 270 degree using Arc() function

Here, we will be using arc() function that is supported by graphics.h header file.

It takes 5 arguments. First two arguments are the coordinates of a circle, its successive two arguments are starting angle and end angle and last one represents the radius of the circle.

The angle value of arc() function can be ranged from 0 to 360 degree.

Syntax:

void arc(coordinateX,coordinateY,startingAngle,closingAngle,radius)

Program to draw an arc from 135 to 270 degree in C

Program:

#include<conio.h>
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
int main()
{
        int gd=DETECT,gm=0;
        initgraph(&gd,&gm,"c:\\tc\\bgi");
       arc(100, 100, 135, 270, 100);
       getch();
       closegraph();
}

Output:

arc function

Leave a Reply