Senin, 08 Oktober 2012

MEMBUAT JAM DENGAN TC

sebelumnya buka software TC lalu masukan coding dibawah ini:

#include"graphics.h"
void main()
{
int x,y;
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
x=getmaxx();
y=getmaxy();

setcolor(3);
setfillstyle(2,6);
circle(240,180,83);

setcolor(5);
setfillstyle(1,3);
circle(240,180,89);

setcolor(8);
settextstyle(1,0,2);
outtextxy(230,100,"12");
outtextxy(230,240,"6");
outtextxy(309,176,"3");
outtextxy(165,176,"9");
outtextxy(275,110,"1");
outtextxy(189,110,"11");
outtextxy(299,140,"2");
outtextxy(165,140,"10");
outtextxy(290,212,"4");
outtextxy(175,212,"8");
outtextxy(270,235,"5");
outtextxy(198,235,"7");

setcolor(9);
setfillstyle(1,9);
line(240,180,240,180);

setcolor(GREEN);
setfillstyle(2,GREEN);
line(240,180,290,212);

setcolor(YELLOW);
setfillstyle(3,YELLOW);
line(240,180,206,110);

setcolor(WHITE);
setfillstyle(3,WHITE);
line(240,180,200,175);

getch();
closegraph();
}


dan hasilnya seperti ini

SELAMAT MENCOBA^_^

Tidak ada komentar:

Posting Komentar