Thursday, October 23, 2014

Your link text here.

undefined

(4) Facebook

How to make a digital clock using C:- ‪#‎include‬ # include # include COORD coord = {0, 0}; void gotoxy (int x, int y) { coord.X = x; coord.Y = y; // X and Y coordinates SetConsoleCurso rPosition(GetStdHandle (STD_OUTPUT_HANDLE) , coord); } void delay(unsigned int mseconds) { clock_t goal = mseconds + clock(); while (goal > clock()); } void showClock(int x_1, int x_2, int x_3,int y){ long i = 0; /* Loop counter */ clock_t now = 0; /* Holds initial clock time */ int interval = 1; /* Seconds interval for o/p */ int elapsed = 0; int min=0,MIN=0,hrs =0,sec=0; int d=0,f=0; now = clock(); /* Get current clock time */ for(i = 0;L; i++){ elapsed = (clock()-now) /CLOCKS_PER_SEC; if(elapsed>=interval){ interval += 1; if(elapsed%60==0){ min=elapsed/60; d=60*min; if(min%60==0){ hrs=min/60; f=60*hrs; } } sec=elapsed-d; MIN=min-f; if(hrs<10){ gotoxy(x_1,y);printf ("0%d",hrs); }else{ gotoxy(x_1,y);printf(":% d",hrs); } if(min<10){ gotoxy(x_2,y);printf (":0%d",MIN); }else{ gotoxy(x_2,y);printf(":% 2d",MIN); } if(sec<10){ gotoxy(x_3,y);printf (":0%d",sec); }else{ gotoxy(x_3,y);printf(":% 2d",sec); } } } } int main() { showClock(2,4,7,4); return 0; }

0 comments:

Post a Comment

Welcome to my Blog!
Bine ati venit pe blogul nostru.
Cand nu sunt pe blog calatorim!!!
When I'm not blogging, I'm traveling :-)

Email me atGuran

Search

Subscribeto this blog
Follow me onTwitter
Connect onFacebook
My Ello

Blogroll


© 2014 by Guran Cosmin.

You're welcome to link to this site or use a single image and brief description to link back to any post. Republishing posts in their entirety is prohibited without permission.

Pictures

Become a Fan

Find Us On Facebook

Contact Form

Name

Email *

Message *

Video

720x90 AdSpace

Recent Videos

Movie

http://youtu.be/Yj0G5UdBJZw
guran. Powered by Blogger.

Wikipedia

Search results

Popular Posts

Followers

Archive

wikiHow - Recent Changes [en]