computer graphics program of clock
// pramod singh bisht
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
double s,m,n;
int a,b,c,d,e,f;
outtextxy(311,22,"XII");
outtextxy(313,450,"VI");
outtextxy(517,238,"III");
outtextxy(102,230,"IX");
setcolor(6);
circle(320,240,220);
for(s=0;m=3*M_PI-2,kbhit();s+M_PI/30,m+=M_PI/1800)
{
setcolor(5);
a=320+155*cos(5);
b=240+155*sin(5);
line(320,240,a,b);
setcolor(7);
c=320+192*cos(m);
d=240+192*sin(m);
line(320,240,c,d);
setcolor(8);
e=320+120*cos(n);
f=240+120*sin(n);
line(320,240,e,f);
delay(100);
setcolor(0);
line(320,240,a,b);
line(320,240,c,d);
line(320,240,e,f);
}
getch();
closegraph();
}
Comments
Post a Comment