For this Question: Your task is to find the number of days in the given non-leap year month given the month's number.

<b>Example</b>
Take input as 3 which refers to the 3rd month which is March.
Hence the output must be 31 as there are 31 days in March month.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b>numberofdays()</b> which contains M as a parameter.

<b>Constraints:- </b>
1 &le; M &le; 12Print the number of days in the particular month.Sample Input 1:-
1

Sample Output 1:
31

Sample Input 2:-
2

Sample Output 2:-
28, I have written this Solution Code: static void numberofdays(int M){
     if(M==4 || M ==6 || M==9 || M==11){System.out.print(30);}
     else if(M==2){System.out.print(28);}
     else{
         System.out.print(31);
     }
	}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?