Program to draw a circle - c program, C/C++ Programming

Program to draw a circle:

int main(void)


   /* request auto detection */

   int gdriver = DETECT, gmode, errorcode;

   int midx, midy;

   int radius = 100;


   /* initialize graphics and local variables */

   initgraph(&gdriver, &gmode, "f:\\software\\tc\\bgi");


   /* read result of initialization */

   errorcode = graphresult();

   if (errorcode != grOk)  /* an error occurred */


      printf("Graphics error: %s\n", grapherrormsg(errorcode));

      printf("Press any key to halt:");


      exit(1); /* terminate with an error code */



   midx = getmaxx() / 2;

   midy = getmaxy() / 2;



   /* draw the circle */


   circle(midx, midy, radius);


   floodfill(midx, midy, radius);

   /* clean up */



   return 0;


Posted Date: 10/19/2012 5:40:55 AM | Location : United States

Related Discussions:- Program to draw a circle - c program, Assignment Help, Ask Question on Program to draw a circle - c program, Get Answer, Expert's Help, Program to draw a circle - c program Discussions

Write discussion on Program to draw a circle - c program
Your posts are moderated
Related Questions
Newton's method for cube roots is based on the fact that if y is an approximation to the cube root of x, then a better approximation is given by the value: (x/y 2 +2y)/3 (a)

Differentiate between a template class and class template in C++? Ans) Template class: A generic definition or a parameterized class not instantiated until the client gives the

What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T

Q: But operator overloading makes class look ugly; isn't it assumed to make my code clearer? A: Operator overloading makes life simpler for the users of a class, not for develop

for different operation multiple stack

What is Virtual Destructor? Describe it.

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

superposition of two waves

Problem: a) Give and Illustrate with the help of diagrams, four topologies for the Network Information System (NIS). b) Give methods for creating user accounts and groups.

1. De ne a function chomp :: String -> String that selects a run of repeated characters from the start of a string with the run being as long as possible. For example ch