Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float time;
- scanf("%f",&time);
- if((time>=6.)&&(time<11.))
- {
- printf("\nGood Morning\n");
- }
- else if((time>=11.)&&(time<16.))
- {
- printf("\nGood Afternoon\n");
- }
- else if((time>=16.)&&(time<20.))
- {
- printf("\nGood Evening\n");
- }
- else if(((time>=20.)&&(time<24.))||((time>=0.)&&(time<6.)))
- {
- printf("\nGood Night\n");
- }
- else
- {
- printf("\nTime is out of range\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement