SAADQUAMER

Week Number

Jun 8th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. // C program to enter week number and print day of week.
  2. #include<stdio.h>
  3. int main(){
  4. int wk;
  5. printf("Enter Week Number (1-7) :");
  6. scanf("%d",&wk);
  7. if(wk == 1)printf("Saturday\n");
  8. else if(wk == 2)printf("Sunday\n");
  9. else if(wk == 3)printf("Monday\n");
  10. else if(wk == 4)printf("Tuesday\n");
  11. else if(wk == 5)printf("Wednesday\n");
  12. else if(wk == 6)printf("Thursday\n");
  13. else if(wk == 7)printf("Friday\n");
  14. else printf("Invalid Number\n");
  15. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment