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

A: Provided that function parameter is "const reference", compiler create temporary variable in following two ways. a) The actual argument is the correct type, however it isn't

Aim: To implement a program to add two polar coordinates using operator overloading. Code:                       #define PI 3.14 class polar {             double

to find the area under the curve y = f(x) between x = a and x = b

M em b e r d e r e f e r e n c i ng o p e r a t o r s: T h e s e op e r a t o r s w i l l b e d i s c u s s e d l a t

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process

program for factorial

Describe Processing an array? The Single operations which involve complete arrays are not permitted in C language. therefore if a and b are similar arrays (for example same dim

Question: a) Give two uses of NFS. b) Give one advantage of using NFS. c) Explain the following lines as they would be interpreted in the /etc/exports file i. /usr/local