C Program For Creating A Clock

/////////////////////////////////////////////////////////////////////////////
//     Clock Project....                      //
/////////////////////////////////////////////////////////////////////////////
 
#include<constream.h>
#include<graphics.h>
void main(){
int gm,gd = DETECT;
initgraph(&gd,&gm,"e:\\tc\\bgi");
cleardevice();
 settextstyle(10,0,5);
 setcolor(YELLOW);

 outtextxy(180,20,"CLOCK.");
 setcolor(4);
 outtextxy(182,22,"CLOCK.");


 settextstyle(0,0,0);

 setcolor(YELLOW);
 int scol=235,srow=125,ecol=325,erow=225;
  setcolor(RED);
  rectangle(scol-1,srow-1,ecol+1,erow+1);
  for(int i=0;i<=5;i++){
   setcolor(YELLOW);
   rectangle(scol,srow,ecol,erow);
   scol++;   srow++;
   ecol--;   erow--;
   }
   setcolor(RED);
   rectangle(scol+1,srow+1,ecol-1,erow-1);
  for( i=3;i<=40;i++){
   setcolor(WHITE);
   rectangle(scol+i,srow+i,ecol-i,erow-i);

    }
  setcolor(0);

  outtextxy(271,136,"12");
  outtextxy(293,141,"1");
  outtextxy(252,141,"1");//1 of 11
  outtextxy(258,141,"1");//1 of 11
  outtextxy(259,199,"7");//1 of 11
  outtextxy(249,186,"8");
  outtextxy(304,153,"2");
  outtextxy(246,153,"1");
  outtextxy(252,153,"0");
  outtextxy(304,153,"2");
  outtextxy(293,199,"5");
  outtextxy(304,186,"4");
  outtextxy(276,206,"6");
  outtextxy(246,170,"9");
  outtextxy(308,170,"3");



 for(i=0;i<=3;i++){
  setcolor(RED);
  circle(280,172,i);}
  line(280,171,261,171);
  line(280,172,261,172);
  //line(280,10,280,400);
  line(280,172,280,145);
  line(281,172,281,145);
  getch();
getch();


}
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment