C program to Create a Digital Clock.

My humble request to user please try this program on your PC/ Mobile/Laptop and See amazing Output we get.

$$Digital Clock Program $$


#include<stdio.h>
#include<conio.h>
void main()
{
int h=0,m=0,s=0;
double j;
clrscr();
printf("Enter time in format HH:MM:SS");
scanf("%d%d%d",&h,&m,&s);
start:
for(h;h<24;h++)
{
for(m;m<60;m++)
{
for(s;s<60;s++)
{
   clrscr();
   printf("\n\n\n%d:%d:%d",h,m,s);
   printf("\n\n");
   if(h<12)
  {
   printf(" AM");
  }
else
{
printf(" PM");
}
for(double j=0;j<3619999;j++)
j++;
j--;
}
s=0;
}
m=0;
}
h=0;
goto start;
getch();
}




Post a Comment

0 Comments