Simple C Program for Moving Object

#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT,gm,xlimit,left=100,top=100,right=200,bottom=200,x= 200,y=200,radius=50;

   //initgraph(&gd, &gm, "C:\\TC\\BGI");
    initgraph(&gd,&gm,"C:\\Turboc3\\bgi");

 //  rectangle(left, top, right, bottom);
 // circle(x, y, radius);
//   bar(left + 300, top, right + 300, bottom);
    xlimit=getmaxx();

  outtextxy(left + 100, top + 325, "My First C Graphics Program");

 for(;x<=xlimit,x++)
 {

   line(x-100,y+100,x-50,y+40);
   line(x-100,y-100,x-50,y-40);
   line(x+70,y-30,x+50,y-100);
   line(x+70,y+30,x+50,y+100);
   ellipse(x, y ,0,360,100, 40);
   fillellipse(x+80,y,10,10);
 line(x-100,y+100,x-100,y-100);
  cleardevice();
 }
   getch();
   closegraph();
   return 0;
}


post your comments here....



Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment