Witshaper is the Professional (Computing Skills, English Learning and Soft Skills) Skill Development Training Center. We provide Professional IT Courses and Soft Skill Training in Dehradun to Students, Employees and organization. Who wish to pursue a career in IT Technology. Witshaper is led by a motivated team of IT experts and Soft Skill Professionals. We provide high quality trainings. Our Emphasis is on giving the practical knowledge to the students, so that they will get to know in depth and never forget what they opt, we provide to the students real learning environment. Witshaper prepares students and professionals to be the part of this growing industry. Be a part of Witshaper and get your dreams successful

Monday, 18 May 2015

java program to show the concept of if.......... else if



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