Advertisement
mhrabbi

enter week number and print day of week(Prob5)

Jun 21st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int weekday;
  5.  
  6.     printf("Enter Weekday: (1-7)\n");
  7.     scanf("%d",&weekday);
  8.  
  9.     if(weekday == 1)
  10.     {
  11.         printf("Today is Saturday");
  12.     }
  13.     else if(weekday == 2)
  14.     {
  15.         printf("Today is Sunday");
  16.  
  17.     }
  18.     else if(weekday == 3)
  19.     {
  20.         printf("Today is Monday");
  21.  
  22.     }
  23.     else if(weekday == 4)
  24.     {
  25.         printf("Today is Tuesday");
  26.     }
  27.     else if(weekday == 5)
  28.     {
  29.         printf("Today is Wednesday");
  30.     }
  31.     else if(weekday == 6)
  32.     {
  33.         printf("Today is Thursday");
  34.     }
  35.     else if(weekday == 7)
  36.     {
  37.         printf("Today is Friday");
  38.  
  39.     }
  40.     else
  41.     {
  42.         printf("Please Input between 1-7");
  43.     }
  44.  
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement