C program to draw a circle in c graphics.
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
initgraph(&gd,&gm,"C:\\tc\\bgi");
circle(150,150,90);
getch();
closegraph();
return 0;
}
- Syntax of drawing circle in c graphics is circle(int x, int y, int radius).
- The first two arguments are used to define center of the circle in x and y co-ordinates.
- Third argument of the circle is its radius in pixels.
C program to draw circle.
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
initgraph(&gd,&gm,"C:\\tc\\bgi");
circle(150,150,90);
getch();
closegraph();
return 0;
}
Download |
---|
(b)
ReplyDelete