Midpoint Circle Algorithm in C and C++

Here you will get program for midpoint circle algorithm in C and C++. It is an algorithm used in computer graphics for drawing circle.

This program will work in Turbo C or Turbo C++ compiler as it uses graphics.h header file.

Change the path of BGI file inside initgraph() function according to your system to make this program run.

Program for Midpoint Circle Algorithm in C

Program for Midpoint Circle Algorithm in C++

Output

Midpoint Circle Algorithm in C and C++

9 thoughts on “Midpoint Circle Algorithm in C and C++

  1. avick

    hello sir…
    while i run this programme in turbo c++ 4.0 compiler, it takes the input of radius, x and y then shows…
    BGI Error:Graphics not initialized (use ‘initgraph’)…

    Reply
    1. Umer Shahzad

      bro! read the lines before the program. it is directed “Change the path of BGI file inside initgraph() function according to your system to make this program run”.

      Reply
    2. Incarnate87

      change directory to bgi first,then save program again…also check linker to confirm graphics.h file is included or not

      Reply
  2. SANAT

    YOUR PROGRAM IS CORRECT BUT YOU SHOULD PUT A DELAY
    FUNCTION IN WHILE LOOP.
    OTHERWISE VERY GOOD FOR PROGRAMME.

    Reply
  3. Ev

    Interesting example you’ve got here. I’ve tested already few code bits that using Bresenham algorithm, i have to say, your implementation is most ’round’ one 🙂

    Little question, how would you fill the circle with your method?

    Cheers,
    Ev

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.