C program to draw a circle.

Posted by Mangesh on April 29, 2018

/* program to draw a circle. */

Description :

In order to make a circle we need to have the coordinates of center and the length of radius. syntax for circle, circle(x, y, radius).

Program :

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
void main() {
   int gdriver = DETECT, gmode;
   int x1 = 200, y1 = 200;
   int radius = 50;

   initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
   circle(x1, y1, radius);
   getch();
   closegraph();
}

Output :

c program to draw a circle Executed and tested in Turbo C 3.2

Written with from Mangesh.

Related Post
1 C program for scaling of 2D object.
2 C program to tramsform 2D objects.
3 C program to draw a line.
4 C program to draw a circle.
5 C program to draw a rectangle.
6 C program for DDA algorithm to generate line.
7 C program for midpoint circle algorithm.
8 C program to draw a bar graph.
9 C program for bresenham's circle drawing algorithm.
Latest Post
1 shubhanshu
2 test
3 C program for Breadth First Search.
4 C program for Depth First Search(DFS).
5 C for circular queue using linked list.