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

Assignment Help:

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;

}


Related Discussions:- Program to draw a circle - c program

What are the different steps in executing a c program, Question 1 What are...

Question 1 What are the different steps in executing a C program? Explain Question 2 What are the commonly used input/output functions in C? How are they accessed?

C program to handle stack using exception handling, Aim: To implement a pr...

Aim: To implement a program to handle stack overflow, underflow and odd number exception using Exception Handling. Code: #include #include #include #define MAX

Game coding, polishing the jewel game with c coding

polishing the jewel game with c coding

Programming C/C++ need a answer, 3. Write a program to encrypt and decrypt...

3. Write a program to encrypt and decrypt strings of characters using the following ciphers: a) Caesar cipher b) Vigenere cipher c) Matrix transposition cipher Your program shoul

Expression, i need expression and its types with example programs in c++

i need expression and its types with example programs in c++

Program for queue and vector, #include #include #include usi...

#include #include #include using namespace std; #define MAX 5 #define INF (1 #define DEBUG if(0) #define pii pair #define pb(x) push_back(x) class

Why shouldn''t matrix class''s interface look like an array, Why shouldn't ...

Why shouldn't Matrix class's interface look like an array-of-array? A: Some people build a Matrix class that has an operator[] that returns a reference to an Array object (or po

Nonlinear least squares minimization, Estimation of the yield curve using n...

Estimation of the yield curve using nonlinear least squares minimization: The last part of this assignment asks you to construct the Nelson Siegel yield curve from observed bond pr

Loan negotiation is usually not a straightforward ta, Ask question #Minimum...

Ask question #Minimum 1Loan negotiation is usually not a straightforward task. A type of loan is the discount installment loan. This type of loan has the following characteristics.

Write a program to act as an electronic safe, Write a program to act as an ...

Write a program to act as an electronic safe. If the correct code has been entered the program should display "Safe Open".  If an incorrect code is input it should display "Alarm"

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd