circle

Overview :

The "circle" function is used to draw a circle in graphics mode.

Syntax :
void circle(int x,int y,int radius);
Description :
The "circle" function accepts 3 parameters
  • x -> The x co-ordinate of the screen where the circle has to be drawn

  • y -> The y co-ordinate of the screen where the circle has to be drawn

  • radius -> This parameter is used for giving radius of the circle

"circle" function does not return any value.

Example :
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main()
{
    
   int gm,gd=DETECT;
   int x,y,radius;
  
  printf("\nEnter the (x,y) co-ordinate : ");
   scanf("%d%d",&x,&y);
   
   printf("\nEnter the radius : ");
   scanf("%d",&radius);
   
   initgraph(&gd,&gm,"C:\\turboc3\\bgi");
   setcolor(10);
   
   circle(x,y,radius);
   
   getch();
   closegraph();
   return 0;
}


Comments

comments powered by Disqus