Articles

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

Share

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:

This post was last modified on August 26, 2022

Sandeep Verma

Published by
Sandeep Verma
Tags: arc function C c graphics program