#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
 int ms=0,s=0,m=0,h=0,d=0,month=0,year=0,i,j;
 do
 {
  clrscr();
  printf("This is Super Clock\n   ");
  printf("\n\n");
  printf("%04d:%02d:%02d:%02d:%02d:%02d:%03d",year,month,d,h,m,s,ms);
  delay(1);
  ms++;
  if(ms>99)
  {
   ms=0;
   s++;
   if(s>59)
   {
    s=0;
    m++;
    if(m>59)
    {
     m=0;
     h++;
     if(h>23)
     {
      h=0;
      h++;
      if(d>31)
      {
       d=0;
       d++;
       if(month>12)
       {
       month=0;
       month++;
       }
      }
     }
    }
   }
  }
 }while(!kbhit());
getch();
}

Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA