create a Java Program to display the corresponding day of the week using the switch case statement
Answers
Answered by
9
Heya user ,
Here is your answer !!
_________
public class Days
{
public static void main ( int ch )
{
switch ( ch )
{
case 1 :
System.out.println ( " Monday " ) ;
break ;
case 2 :
System.out.println ( " Tuesday " ) ;
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 ( " Wrong choice " ) ;
}
}
}
_________
Hope it helps !!
Here is your answer !!
_________
public class Days
{
public static void main ( int ch )
{
switch ( ch )
{
case 1 :
System.out.println ( " Monday " ) ;
break ;
case 2 :
System.out.println ( " Tuesday " ) ;
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 ( " Wrong choice " ) ;
}
}
}
_________
Hope it helps !!
Incredible29:
plz follow if u lyk my answer
Similar questions