-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoopAssignment7.java
More file actions
29 lines (25 loc) · 733 Bytes
/
Copy pathLoopAssignment7.java
File metadata and controls
29 lines (25 loc) · 733 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
package java_core;
public class LoopAssignment7 {
void displayDate(int day, int month, int year){
++day;
if(month == 1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12){
if(day>31){
month++;
day =1;
}
}
else if(day>30){
month++;
day=1;
}
if(month>12){
++year;
month=1;
}
System.out.println(day+"-"+month+"-"+year);
}
public static void main(String args []){
LoopAssignment7 object = new LoopAssignment7();
object.displayDate(31, 12, 1999);
}
}