Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Jess Thiele
- Date: 20/01/2019
- Purpose: Print the day of the week that corresponds to a number
- */
- #include "stdafx.h"
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int num;
- printf("Enter your number ");
- scanf_s("%d", &num);
- switch (num)
- {
- case 1:
- printf("\nMonday\n");
- break;
- case 2:
- printf("\nTuesday\n");
- break;
- case 3:
- printf("\nWednesday\n");
- break;
- case 4:
- printf("\nThursday\n");
- break;
- case 5:
- printf("\nFriday\n");
- break;
- case 6:
- printf("\nSaturday\n");
- break;
- case 7:
- printf("\nSunday\n");
- break;
- default:
- printf("\nThat number does not corrospond to a day of the week\n");
- break;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement