You are on page 1of 2

Graphics 12

============================================
#include <conio.h>
#include <iostream.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();
settextstyle (10,0,5);

while (!kbhit())
{
int x=0;
int y=-25;
while (x<=xmax-200)
{
setcolor(YELLOW);
outtextxy(x,y,"FAHAD");
x=x+10;
y=y+2;
delay(100);
cleardevice();
}

while (x>=0)
{
setcolor(RED);
outtextxy(x,y,"FAHAD");
x=x-10;
y=y+2;
delay(100);
cleardevice();
}

while (x<=xmax-200)
{
setcolor(BLUE);
outtextxy(x,y,"FAHAD");
x=x+10;
y=y+2;
delay(100);
cleardevice();
}

while (x>=0)
{
setcolor(5);
outtextxy(x,y,"FAHAD");
x=x-10;
y=y+2;
delay(100);
cleardevice();
}

while (y<=ymax-80)
{
setcolor(GREEN);
outtextxy(x,y,"FAHAD");
x=x+10;
y=y+2;
delay(100);
cleardevice();
}
delay(250);
}
getch();

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