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();
}


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.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment