C program to draw an ellipse using mid-point ellipse drawing algorithm

Alogrithm

1. Start.2. Initialize the graphic system using initgraph function.3. Get the input of radius of major and minor arc from the user.4. Store the values of major and minor arc in an another variable.5. Square the values of major and minor arc.6. Calculate decision parameter P = (square of minor axis – (square of major axis*minor axis) + (0.25* square of major axis).7. Put the pixels symmetrically at = (0, length of minor axis).8. while (2*(square of minor axis*x)<=2*(square of major axis*y)), repeat steps 9 to step 17.9. increment x axis by 1.10. If P < 011. new P = (P+( square of minor axis* square of major axis)+ square of major axis)12. Else13. new P = (P+( square of minor axis*x axis)-(2*square of major axis*y axis)+ square of minor axis).14. Decrement y by 1.15. End of step 10 if else structure.16. Plot symmetric points of ellipse in each quadrant.17. End of step 8 loop.18. This will give us ellipse only across minor axis now to draw an ellipse across major axis we proceed further.19. Get last point of ellipse in 1st quadrant.20. Initialize e = square of (x axis+.5)21. Initialize f = square of (y axis-1).22. Decision parameter P1 = ((square of minor axis*e)+( square of major axis*f)-( square of minor axis* square of major axis).23. While y axis != 0 repeat steps 24 to step 32.24. If P1>025. New P1 = (P1+ square of major axis-(2* square of major axis*x axis)).26. Else27. New P1 = (P1+(2*square of minor axis*(x axis+1))-(2* square of major axis*(y axis- 1))+square of major axis).28. Increment x axis by 1.29. End of step 25 if else structure30. Decrement y axis by 1.31. Plot symmetric point in all quadrants32. End of step 23 while loop.33. Close the graphic system.34. Stop.