-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathif3.java
More file actions
21 lines (19 loc) · 510 Bytes
/
if3.java
File metadata and controls
21 lines (19 loc) · 510 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package ifdirect;
import java.util.Scanner;
public class if3 {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
System.out.println("Number:");
int number=scanner.nextInt();
if (number>0){
number++;
System.out.println(number);
}else if (number==0){
number=10;
System.out.println(number);
}else {
number-=2;
System.out.println(number);
}
}
}