/* Name: sunil kumar Email ID: sunilcodex@gmail.com */ #include #include #include void hour12(); void hour24(); int main() { system("color 5E"); system("title Clock"); int t,g; printf("enter 1 (12 hour) / 2 (24 hour)\n"); scanf("%d",&t); switch(t) { case 1: system("cls"); hour12(); // break; case 2: system("cls"); hour24(); break; default: printf("default %d not errar\n",t); } getch(); return 0; } void hour12() { long i; int sec=0,min=0,hour=0,t,g; char ch[4],am[]="AM",pm[]="PM"; printf("enter hour\n"); scanf("%d",&hour); if(13=12&&min==0&&sec==0) { if((g-1)==11) hour=1; if(t==1) { strcpy(ch,pm); t=1; } else { strcpy(ch,am); t=0; } } } goto abc; } void hour24() { long i; int sec=0,min=0,hour=0,t,g; printf("enter hour\n"); scanf("%d",&hour); if(24=24&&min==0&&sec==0) { if((g-1)==23) hour=1; } } goto abc; }