//https://csprograms4u.blogspot.com/
//Chapter 2
//Program 5
//Switch Statement in
Java
import
java.util.Scanner;
public
class SwitchDays
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int day;
System.out.println("Enter day of
the week");
day=sc.nextInt();
switch(day)
{
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tueday");
break;
case 3:
System.out.println("Wednesday");
break;
case 4:
System.out.println("Thursday");
break;
case 5:
System.out.println("Friday");
break;
case 6:
System.out.println("Saturday");
break;
case 7:
System.out.println("Sunday");
break;
default:
System.out.println("Plz enter
correct number");
break;
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.