In: Computer Science
#include<stdio.h>
#include<conio.h>
struct time_of_day
{
   int Hour;
   int Minute;
   float Second;
};
int check_time( time_of_day *t1)
{ int Flag=1;
if (t1->Hour<0 || t1->Hour>23)
   {
   Flag=0;
   }
else if (t1->Minute<0 || t1->Minute>59)
   {
   Flag=0;
   }
else if (t1->Second<0 || t1->Second>59.999999)
   {
   Flag=0;
   }
return Flag;
}
void main()
{
   struct time_of_day T;
   clrscr();
   printf("\nEnter the Hour :");
   scanf("%d",&T.Hour);
   printf("\nEnter the Minute:");
   scanf("%d",&T.Minute);
   printf("\nEnter the Second:");
   scanf("%f",&T.Second);
   int R=check_time(&T);
   if(R==1)
   printf("VALID TIME");
   else
   printf("INVALID TIME");
   getch();
}