Author

Author- Ram Ranjeet Kumar

Tuesday, July 30, 2019

Switch Case Print Week days Program In Java

import java.util.*;
class Switch1
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int ch;
System.out.println("\n\tEnter the Day Number 1 to 7");
ch=sc.nextInt();
switch(ch)
{
case 1:
System.out.println("\n\tMonday");
break;

case 2:
System.out.println("\n\tTuesday");
break;

case 3:
System.out.println("\n\tWednesday");
break;

case 4:
System.out.println("\n\tThrusday");
break;

case 5:
System.out.println("\n\tFriday");
break;

case 6:
System.out.println("\n\tSaturday");
break;

case 7:
System.out.println("\n\tSunday");
break;

default:
System.out.println("\n\tWrong Entry");
break;
}
}
}

No comments:

Post a Comment