Advertisement
Dido09

C - Days of the Week

Feb 27th, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int day;
  7. printf("Enter the number of the day: ");
  8. scanf("%d", &day);
  9.  
  10. switch(day){
  11. case 1:
  12. printf("Monday");
  13. break;
  14. case 2:
  15. printf("Tuesday");
  16. break;
  17. case 3:
  18. printf("Wednesday");
  19. break;
  20. case 4:
  21. printf("Thursday");
  22. break;
  23. case 5:
  24. printf("Friday");
  25. break;
  26. case 6:
  27. printf("Saturday");
  28. break;
  29. case 7:
  30. printf("Sunday");
  31. break;
  32. default:
  33. printf("Invalid input");
  34. break;
  35. }
  36.  
  37.  
  38. return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement