What is the graphics in C programming? How can I write code for circle, rectangle and Triangle? How can I make my application in C using graphics?
What is the graphics in C programming? How can I write code for circle, rectangle and Triangle? How can I make my application in C using graphics?
1) Creating circle in graphics in C:
/* Sample program to draw a circle*/
#include<graphics.h>
#include<conio.h>
main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,""); /* initialization of graphic mode */
circle(150,150,100);
getch();
closegraph(); /* Restore orignal screen mode */
}
C is mother language of the newer programming languages .It was designed to be compiled using a straightforward compiler that execute the code using top to down approach.
C supports a rich set of operators, which are symbols used within an expression and programmer can perform a lot of operation and calculation using variables and many more like:
• Union and structure
• Basic data types and operators
• File handling
• Graphics
• Functions
• Pointers
Using these we can build a strong application.
Bookmarks