To print days of week using switch case in java

CODE :

class P_03_print_day_switch_case_part3 {
public static void main(String[] args) {
int a=1;
switch (a) {
case 0:
System.out.println("Today is Monday");
break;
case 1:
System.out.println("Today is Tuesday");
break;
case 2:
System.out.println("Today is Wednesday");
break;
case 3:
System.out.println("Today is Thursday");
break;
case 4:
System.out.println("Today is Friday");
break;
case 5:
System.out.println("Today is Saturday");
break;
case 6:
System.out.println("Today is Sunday");
break;
default:
System.out.println("You are doomed");
}
}

}

Output : 



Comments

Popular posts from this blog

Program to illustrate the concept of templates.

To create an html file to implement the concept of margin, padding using cascading style sheets.

To configure the IP address for a computer connected to LAN