Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int time;
- char name[25];
- printf("What is your name?\n");
- scanf("%s", name);
- printf("What is the time?\n");
- scanf("%d", &time);
- time >= 0 && time <= 2400 ?
- time >= 400 && time <= 2300 ?
- printf("Good %s, %s!\n", time <= 1200 ? "Morning" : (time <= 1600 ? "Afternoon" : "Evening"), name)
- :
- puts("What are you doing up?\n")
- :
- puts("Wrong time input!\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement