Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num;
- int days[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
- cout << "Enter a number of the month to see the number of days in that month: ";
- cin >> num;
- if (num > 0 && num <= 12)
- {
- --num;
- cout << "Days of this month equal: " << days[num] << endl;
- }
- else
- {
- cout << "Invalid month" << endl;
- }
- //system("pause");
- return 0;
- } //end of main function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement