I was told to check if my booking time to and from are taken.
So how do i check it?
i was told to use if(condition) , but i do not know what to put inside the condition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
float timef=900;
printf("Booking time from (24hours) :");
scanf("%f",&timef);
while(timef <900 || timef > 2100)
{ printf("***************** [Error Message : Please Re-enter it] *********************** \n");
printf("Booking time from (24hours) : ");
scanf("%f",&timef);}
float timet=900;
printf("Booking time to (24hours) : ");
scanf("%f",&timet);
while(timet <900 || timet > 2100 )
{ printf("***************** [Error Message : Please Re-enter it] ************************ \n");
printf("Booking time to (24hours): ");
scanf("%f",&timet);}
}
is there any others ways of doing it?
because i'm still a beginner.i don't really understand it.
And i was to told present my this programme to my teacher.