Advertisement
mominulkarim77

Good Morning by Mosharof Rimon

Mar 5th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1.  #include <stdio.h>
  2. int main()
  3. {
  4. float time;
  5. scanf("%f",&time);
  6. if((time>=6.)&&(time<11.))
  7. {
  8. printf("\nGood Morning\n");
  9. }
  10. else if((time>=11.)&&(time<16.))
  11. {
  12. printf("\nGood Afternoon\n");
  13. }
  14. else if((time>=16.)&&(time<20.))
  15. {
  16. printf("\nGood Evening\n");
  17. }
  18. else if(((time>=20.)&&(time<24.))||((time>=0.)&&(time<6.)))
  19. {
  20. printf("\nGood Night\n");
  21. }
  22. else
  23. {
  24. printf("\nTime is out of range\n");
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement