How To Make A Stopwatch By C Programming

How To Make A Stopwatch By C Programming

#include <windows.h>
#include <stdio.h>
#include <conio.h>
int main()
{
    int h,m,s,ms;
    printf("\t\t\t Stopwatch\n");
    printf("-------------------------------------------------------------------------------\n");
    printf("\t\t\tTime Running.......\n\n");
    printf("\tHour\tMinute\tSecond\tMiliseconds\n\n");
    for(h=0;h<24;h++)
    {
        for(m=0;m<60;m++)
        {
            for(s=0;s<60;s++)
            {
                for(ms=0;ms<100;ms++)
                {
                    printf("\t%.2d\t%.2d\t%.2d\t%.2d\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b",h,m,s,ms);
                    Sleep(10);
                }
            }
        }
    }
    getch();
}


Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment