You are on page 1of 2

Graphics 8

============================================
#include <iostream.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
void main()
{
clrscr();
int gdriver = DETECT , gmode;
initgraph (&gdriver,&gmode,"e:\\turbo\\tc\\bgi");
int xmax=getmaxx();
int ymax=getmaxy();
rectangle(0,0,xmax,ymax);
rectangle (0,0,xmax,20);
int dist=xmax/5;
int loc=dist;
char option[1];
bar3d(0,0,loc,20,5,1);
bar3d(loc+7,0,loc+dist,20,5,1);
setcolor(RED);

/*
for (int i=5;i>1;i--)
{
line (loc,0,loc,20);
loc=loc+dist;
}
*/

//settextstyle (3 , 0 , 1);
// font (0-10) angle (0,1) size (0,10)
outtextxy(35,7,"Pyramid");
outtextxy(dist+35,7,"Circle");
outtextxy(2*dist+45,7,"Line");
outtextxy(3*dist+35,7,"Sh.Fahad");
outtextxy(4*dist+35,7,"Zeeshan");
outtextxy(35,27,"Enter Option's First Letter: ");
option[0]=getche();
//char *r=&option;
outtextxy(270,27,option);
if (option[0]=='P'||option[0]=='p')
{
rectangle (0,0,loc+5,20);
setfillstyle(1,14);
floodfill (10,10,RED);
}
if (option[0]=='C'||option[0]=='c')
{
rectangle (loc+6,0,loc+dist+6,20);
setfillstyle(1,14);
floodfill (loc+10,10,RED);
}

getch();
}

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