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
- Print a Binary Tree in Vertical Order | Set 2 (Map based Method)
- C program to check if a given year is leap year using Conditional operator
- Program to check if a given year is leap year
- Program to print number pattern
- Print multiples of Unit Digit of Given Number
- Program to print number with star pattern
- Program to print 'N' alphabet using the number pattern from 1 to n
- Program to print all the numbers divisible by 3 and 5 for a given number
- Program to print multiplication table of a number
- Program to print the berth of given railway seat number
- Print all the sum pairs which occur maximum number of times
- Queries to insert, delete one occurrence of a number and print the least and most frequent element
- Program to find century for a year
- Why is programming important for first year or school students?
- Amazon Interview Experience | Set 356 (For 6 Year Experienced)
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.