-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJAVA48.java
More file actions
33 lines (29 loc) · 995 Bytes
/
Copy pathJAVA48.java
File metadata and controls
33 lines (29 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
public class JAVA48 {
/*CONDITIONAL STATEMENTS QUESTIONS
Question1:
Write a Java program that takes a year from the user and print whether that year is a leap year or not.*/
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
String day =sc.next();
switch(day)
{case"m":
case "M":System.out.println("Monday");
break;
case"t":
case "T":System.out.println("Tuesday\nThursday");
break;
case"w":
case "W":System.out.println("Wednesday");
break;
case"f":
case "F":System.out.println("Friday");
break ;
case"s":
case "S":System.out.println("Saturday\nSunday");
break;
default :
System.out.println("Sorry! You Have entered incorrect input");
}
}
}