This function is used to draw an elliptical arc in the graphics mode.We can draw full ellipse also using this function.
void ellipse(int x,int y,int stangle,int endangle,int x_radius,int y_radius);
The "ellipse" function accepts 6 parameters
To draw a full ellipse from this function we need to set stangle = 0 and endangle = 360.
#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main() { int gm,gd=DETECT; int x,y,stangle,endangle,x_radius,y_radius; printf("\nEnter the (x,y) co-ordinate : "); scanf("%d%d",&x,&y); printf("\nEnter the starting and ending angle : "); scanf("%d%d",&stangle,&endangle); printf("\nEnter the x-radius and y-radius: "); scanf("%d%d",&x_radius,&y_radius); initgraph(&gd,&gm,"C:\\turboc3\\bgi"); setcolor(10); ellipse(x,y,stangle,endangle,x_radius,y_radius); getch(); closegraph(); return 0; }
Image Of Getting Co-ordinates
![]()
Final Output