import java.util.*;
public class Switch {
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter number");
int number=scan.nextInt();
switch(number){
case 1: System.out.println("SUNDAY");break;
case 2: System.out.println("MONDAY");break;
case 3: System.out.println("TUESDAY");break;
case 4:System.out.println("WEDNESDAY");break;
case 5:System.out.println("THRUSDAY");break;
case 6:System.out.println("FRIDAY");break;
case 7:System.out.println("SATURDAY");break;
default:System.out.println("invalid number");
}
}
}
public class Switch {
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter number");
int number=scan.nextInt();
switch(number){
case 1: System.out.println("SUNDAY");break;
case 2: System.out.println("MONDAY");break;
case 3: System.out.println("TUESDAY");break;
case 4:System.out.println("WEDNESDAY");break;
case 5:System.out.println("THRUSDAY");break;
case 6:System.out.println("FRIDAY");break;
case 7:System.out.println("SATURDAY");break;
default:System.out.println("invalid number");
}
}
}
No comments:
Post a Comment