Given the month number M, the task is to print the season name of the year based on the month number.
Input: M = 5 Output: SPRING Input: M = 1 Output: WINTER
- There are 4 main seasons in a year, that is, Summer, Autumn, Winter and Spring.
- The winter months are in December, January and February.
- The spring months in March, April and May.
- The summer months in June, July and August.
- And the autumn months in September, October and November.
- So map the month to the particular season respectively and print it.
Below is the implementation of the above approach:
For Month number: 5 SPRING For Month number: 10 AUTUMN
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- C program to display month by month calendar for a given year
- Program to check if a given year is leap year
- C program to check if a given year is leap year using Conditional operator
- C program to print number of days in a month
- Program to print the initials of a name with the surname
- Print a Binary Tree in Vertical Order | Set 2 (Map based Method)
- Calendar Functions in Python | Set 1( calendar(), month(), isleap()...)
- Amazon Interview Experience | Set 355 (For 1 Year Experienced)
- Amazon Interview Experience | Set 356 (For 6 Year Experienced)
- Program to find century for a year
- Why is programming important for first year or school students?
- How to calculate the Easter date for a given year using Gauss' Algorithm
- Top 20 Hashing Technique based Interview Questions
- Queue based approach for first non-repeating character in a stream
- Program to calculate Percentile of a student based on rank
- Convert a given temperature to another system based on given boiling and freezing points
- Maximum Count of pairs having equal Sum based on the given conditions
- Sum of indices of Characters removed to obtain an Empty String based on given conditions
- Minimum moves required to type a word in QWERTY based keyboard
- Generate a String from given Strings P and Q based on the given conditions
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.