Add to Favorites    Make Home Page 14289 Online  
 Language Categories  
 Our Services  

Home » C Home » Beginners / Lab Assignments Home » Analog and Digital clock

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Analog and Digital clock
Author Dhunna Mohammed Vasim
Author Email vasimdhunna [at] rediffmail.com
Description This program for Digital/Analog wall clock ask
for password which is "jalpari" and then it starts
displaying the current time.
Category C » Beginners / Lab Assignments
Hits 384737
Code Select and Copy the Code
# include <graphics.h> # include <stdio.h> # include <dos.h> # include <string.h> # include <math.h> # define pi 3.141592654 int x; float x30,x60,y30,y60; void paint1() { setcolor(GREEN); outtextxy(297,60,""); outtextxy(297,332,""); outtextxy(435,198,""); outtextxy(160,198,""); setcolor(RED); outtextxy(375,85,"�"); outtextxy(420,260,"�"); outtextxy(170,135,"�"); outtextxy(220,310,"�"); setcolor(LIGHTBLUE); outtextxy(420,135,"�"); outtextxy(375,310,"�"); outtextxy(220,83,"�"); outtextxy(175,260,"�"); } void paint2() { setcolor(RED); outtextxy(297,60,"�"); outtextxy(297,332,"�"); outtextxy(435,198,"�"); outtextxy(160,198,"�"); setcolor(LIGHTBLUE); outtextxy(375,85,"�"); outtextxy(420,260,"�"); outtextxy(170,135,"�"); outtextxy(220,310,"�"); setcolor(GREEN); outtextxy(420,135,""); outtextxy(375,310,""); outtextxy(220,83,""); outtextxy(175,260,""); } void paint3() { setcolor(LIGHTBLUE); outtextxy(297,60,"�"); outtextxy(297,332,"�"); outtextxy(435,198,"�"); outtextxy(160,198,"�"); setcolor(GREEN); outtextxy(375,85,""); outtextxy(420,260,""); outtextxy(170,135,""); outtextxy(220,310,""); setcolor(RED); outtextxy(420,135,"�"); outtextxy(375,310,"�"); outtextxy(220,83,"�"); outtextxy(175,260,"�"); } void graph() { cleardevice(); setcolor((++x)%15+1); if(x%2) outtextxy(180,10,"THERE IS NO GOD EXCEPT ALLAH"); else outtextxy(130,20,"PRAISE ALLAH THE MOST BENEFICIENT AND MERCIFUL"); setcolor(GREEN); circle (300,200,150); circle(300,200,2); setcolor(14); circle (300,200,100); setcolor(3); circle (300,200,120); setcolor(RED); circle(300,50,2); circle(450,200,2); circle(150,200,2); circle(300,350,2); setcolor(BLUE); circle(300+x30,200+y30,2);//1 circle(300-x30,200+y30,2);//11 circle(300+x30,200-y30,2);//5 circle(300-x30,200-y30,2);//7 circle(300+x60,200+y60,2);//2 circle(300+x60,200-y60,2);//4 circle(300-x60,200-y60,2);//8 circle(300-x60,200+y60,2);//10 if(x%2) { setcolor(x); outtextxy(300+x30*1.1,200+y30*1.1,"1");//1 outtextxy(300-x30*1.1,200+y30*1.1,"11");//11 outtextxy(300+x30*1.1,200-y30*1.1,"5");//5 outtextxy(300-x30*1.1,200-y30*1.1,"7");//7 outtextxy(300+x60*1.1,200+y60*1.1,"2");//2 outtextxy(300+x60*1.1,200-y60*1.1,"4");//4 outtextxy(300-x60*1.1,200-y60*1.1,"8");//8 outtextxy(300-x60*1.15,200+y60*1.1,"10");//10 outtextxy(460,200,"3"); outtextxy(300,360,"6"); outtextxy(140,200,"9"); outtextxy(290,40,"12"); } } void plot(int h , int m , int s) { char a[2],b[2],c[2]; setcolor( LIGHTCYAN ); itoa(h,a,10); outtextxy(450,100,a); outtextxy(470,100,":"); itoa(m,a,10); outtextxy(490,100,a); outtextxy(510,100,":"); itoa(s,a,10); outtextxy(530,100,a); setcolor( LIGHTGREEN ); if( h<13 ) outtextxy( 290 , 250 , "AM"); else outtextxy( 290 , 250, "PM"); h=h%12; setlinestyle(SOLID_LINE , 1 , 3); setcolor( RED ); line(300,200,300+floor(100*cos(((h*5+m/10.0)*6-90)*pi/180)), 200+floor(100*sin(((h*5+m/10.0)*6-90)*pi/180))); setcolor(BLUE); setlinestyle(SOLID_LINE,1,3); line(300,200,300+floor(120*cos((m*6-90)*pi/180)), 200+floor(120*sin((m*6-90)*pi/180))); setcolor(MAGENTA); setlinestyle(SOLID_LINE,1,1); line(300,200,300+floor(120*cos((s*6-90)*pi/180)), 200+floor(120*sin((s*6-90)*pi/180))); } void timexy() { int h,m,s; struct time t; while(1) { //clrscr(); cleardevice(); graph(); gettime(&t); //printf(" The current time is: %2d:%02d:%02d.%02d ", // t.ti_hour, t.ti_min, t.ti_sec,t.ti_hund); h=t.ti_hour; m=t.ti_min; s=t.ti_sec; if(s%3==0) paint1(); else if(s%3==1) paint3(); else paint2(); plot(h,m,s); delay(995); } } main() { int i=DETECT,m; char a[100],b[10]="jalpari"; x30=floor(150*cos((30-90)*pi/180)); y30=floor(150*sin((30-90)*pi/180)); x60=floor(150*cos((60-90)*pi/180)); y60=floor(150*sin((60-90)*pi/180)); initgraph(&i,&m,"d:\tc\bgi"); i=0; printf(" PASSWORD==>"); do { a[i]=getch(); if(!(a[i]==(char)13)) { printf("vasim"); i++; } else {a[i]='

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi �դ ?�� ��??���
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=728


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review