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:");

      getch();

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

   }

 

   midx = getmaxx() / 2;

   midy = getmaxy() / 2;

   setcolor(getmaxcolor());

 

   /* draw the circle */

   setcolor(RED);

   circle(midx, midy, radius);

   szetcolor(GREEN);

   floodfill(midx, midy, radius);

   /* clean up */

   getch();

   closegraph();

   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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

what is spanning tree? explain prims algorithm spanning tree?

Using your mountain project source code as a starting point, you are to write a code that randomly chooses one of the triangles on the surface of your mountain, this will be the en

In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh

Greatest Common Divisor (GCD) - The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves intege

When I develop a destructor, do I require to explicitly call the destructors for my member objects?


Question 1 Write a program that accepts two numbers from the user and swaps the two numbers without using a temporary variable Question 2 Write a program that accepts a 3x

A: Something to let your class to grant access to another class or function. Friends may be either classes or functions. Class grants access privileges to its friends. In genera

I have a program for school and I am not understanding why one of the variables gets skipped or the arithmetic operators aren''t having any effect as I have tryed defining it sever