Walking Man using C / C++

PROGRAM;

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gdriver = DETECT,gmode,i;
int x1=100,t1=x1-30,t2=x1+30;
int a1=t1,a2=t2;
initgraph(&gdriver,&gmode,"C:\\TC\\BGI");
for(i=0;i<30;i++)
{
for(;t1<x1+30&&t2>x1-30;t1++,x1++,t2--)
{
delay(50);
clrscr();
line(0,310,1366,310);
circle(x1,100,30);
line(x1,130,x1,220);
line(x1,150,a1=a1+5,200);
line(x1,150,a2=a2-3,200);
line(x1,220,t1=t1+4,310);
line(x1,220,t2=t2-2,310);
}
t1=x1-30;t2=x1+30;a1=t1;a2=t2;

}
getch();

}

OUTPUT:


Comments

  1. sir,
    iam getting fatal error when i run this code.It has no errors other than that.
    what is the solution?

    ReplyDelete

Post a Comment

Popular posts from this blog

Bouncing Ball using C / C++

My review : HP Pavilion 15-n209TX Laptop