import java.util.Scanner;
class Year{
public static void main(String args[]){
int i;
System.out.println("Enter the Number of the year");
Scanner in=new Scanner(System.in);
i=in.nextInt();
if(i==1)
System.out.println("Month is Janurary");
else if(i==2)
System.out.println("Month is Feburary");
else if(i==3)
System.out.println("Month is March");
else if(i==4)
System.out.println("Month is April");
else if(i==5)
System.out.println("Month is May");
else if(i==6)
System.out.println("Month is June");
else if(i==7)
System.out.println("Month is July");
else if(i==8)
System.out.println("Month is August");
else if(i==9)
System.out.println("Month is September");
else if(i==10)
System.out.println("Month is October");
else if(i==11)
System.out.println("Month is November");
else if(i==12)
System.out.println("Month is December");
else if(i==0||i>12)
System.out.println("Enter valid year Number");
}
}
No comments:
Post a Comment