You are on page 1of 2

Graphics 1

============================================
#include <conio.h>
#include <iostream.h>
#include <dos.h>
#include <graphics.h>
void main()
{
clrscr();
int gdriver = DETECT, gmode;
initgraph(&gdriver,&gmode,"E:\\turbo\\tc\\bgi");
rectangle (130,50,480,400);
rectangle (130,50,480,90);
rectangle (450,90,480,110);
rectangle (370,350,400,370);
rectangle (340,350,370,370);
setcolor(RED);
int x,y,xmax,ymax;
xmax=getmaxx();
ymax=getmaxy();
outtextxy(458,97,"ON");
outtextxy(382,357,"1");
outtextxy(352,357,"2");
char c=0;

c=getch();
if (c=='o'||c=='O')
{
setfillstyle(SOLID_FILL,GREEN);
floodfill(458,97,WHITE);
setcolor(RED);
outtextxy(458,97,"ON");
}
else if (c=='1')
{
setfillstyle(SOLID_FILL,GREEN);
floodfill(382,357,WHITE);
setcolor(RED);
outtextxy(382,357,"1");
outtextxy(450,70,"1");
delay (200);
setfillstyle(EMPTY_FILL,GREEN);
floodfill(382,357,WHITE);
setcolor(RED);
outtextxy(382,357,"1");
}

else if (c=='2')
{
setfillstyle(SOLID_FILL,GREEN);
floodfill(352,357,WHITE);
setcolor(RED);
outtextxy(352,357,"2");
outtextxy(450,70,"2");
delay (200);
setfillstyle(EMPTY_FILL,GREEN);
floodfill(352,357,WHITE);
setcolor(RED);
outtextxy(352,357,"2");
}

getch();

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006