Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int n_mod = n % 7;
- if (n_mod == 1)
- cout << "MONDAY";
- else if (n_mod == 2)
- cout << "TUESDAY";
- else if (n_mod == 3)
- cout << "WEDNESDAY";
- else if (n_mod == 4)
- cout << "FRIDAY";
- else if (n_mod == 5)
- cout << "THURSDAY";
- else if (n_mod == 6)
- cout << "SATURDAY";
- else if (n_mod == 0)
- cout << "SUNDAY";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement