circle – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sun, 14 Aug 2022 08:47:54 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg circle – Programmerbay https://programmerbay.com 32 32 Program to Draw a Circle in C https://programmerbay.com/program-to-draw-a-circle-in-c/ https://programmerbay.com/program-to-draw-a-circle-in-c/#respond Thu, 14 Jul 2022 18:02:07 +0000 https://programmerbay.com/?p=5151 Circle function is one of the library function of Graphics.h header file. It draws a circle on to the output screen.  It takes three arguments, the first two are for centre coordinate and the last one represents the radius of the circle.

Syntax:

circle(x,y,centre);

 

C program to draw a circle using circle function?

Program:

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

void main() { int gd=DETECT,gm;
int x_centre,y_centre,radius; clrscr(); initgraph(&gd,&gm,"C:\\TURBOC3\\BGI"); printf("\n Please enter the centre coordinate of a circle = "); scanf("%d %d",&x_centre,&y_centre); printf("\n Now, \n Please enter the radius = "); scanf("%d",&radius); printf("\n***** CIRCLE ******"); circle(x_centre,y_centre,radius); getch(); closegraph();
}

Output:

circle

 

]]>
https://programmerbay.com/program-to-draw-a-circle-in-c/feed/ 0