Home » » Graphics in C Language with Example

Graphics in C Language with Example

Graphics in C Language with Example

Graphics in C Language with Example

Graphic
     1. Line
     2. Circle
     3. Rectangle
     gd - Graphics drive
     gm - Graphics mode
     r - read
     w - write
     a - append
     initgraph - intialize the graphics

Program 1: 

#include
#include
#include
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
clrscr();
circle(200,150,50);
getch();
close graph();
}

Program 2:

#include
#include
#include
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"circle");
clrscr();
set color(2);
rectangle(200,150,50,100);
set color(4);
rectangle(300,200,100,250);
getch();
close graph();
}

Program 3:

#include
#include
#include
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"circle");
clrscr();
set color(2);
line(200,150,50,100);
set color(4);
line(300,200,100,250);
getch();
close graph();
}

0 coment�rios:

Post a Comment

Link you don't want to vouch for Read more: https://html.com/seo/#ixzz5zVltiZ5g