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.

Your program should use the Free Pascal compiler or the Lazarus IDE described in CSC 540. When you hand in your assignment to the digital dropbox, it should be a .PAS file, not zip

The ability to verify at run time the type of an object by using the typed operator or the dynamic_cast operator.

How to Create A Data File? A data file should be created before it can be processed. A stream-oriented data file is able to be created in two ways. One is to create the file st

Assume we wish to partition the square roots of the integers from 1 to 100 in to two piles of fifty numbers every, such that the sum of the numbers in the first pile is as close as

Program is to define a class as library: Program is to define a class as library and perform all the function of library management by using classes and object class librar


Define Generic Bitwise Operations? Bitwise operators only work on an incomplete number of types int and char. It turns out there's above one kind of int. In particular there's

Program to find a Greatest String: C - Program: Write a program find largest string by c program. int main( int argc, char *argv[] ) {     if( argc         {

I need help to understand and do this assignment ********************************************************* You are to insert the missing code in the C program given for combinatio