Why do we need graphics functions? Write a program to draw a circle.

This answer is restricted. Please login to view the answer of this question.

Login Now

Graphics programming in C used to drawing various geometrical shapes(rectangle, circle eclipse etc), use of mathematical function in drawing curves, coloring an object with different colors and patterns and simple animation programs like jumping ball and moving cars.

C graphics using graphics. h functions or WinBGIM (Windows 7) can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics. You can draw circles, lines, rectangles, bars and many other geometrical figures.

Common used graphics functions are:

  1. Arc()
  2. circle()
  3. closegraph()
  4. ellipse()
  5. getcolor()
  6. getmaxx()
  7. getmaxy()
  8. getpixel()
  9. getx()
  10. gety()
  11. line()
  12. putpixel()
  13. rectangle()
  14. setcolor()

Program Part:

#include<stdio.h>
#include <graphics.h>

int main()
{
    int gd = DETECT, gm;

    initgraph(&gd, &gm, "");

    circle(250, 200, 50);

    closegraph();
    return 0;
}
If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .