-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIf29.java
More file actions
25 lines (23 loc) · 759 Bytes
/
If29.java
File metadata and controls
25 lines (23 loc) · 759 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
package ifdirect;
import java.util.Scanner;
public class If29 {
public static void main(String[] args) {
Scanner scanner = new Scanner (System.in);
int a, b;
System.out.print ("a:");
a = scanner.nextInt ( );
b = a % 2;
System.out.println (b);
if ( a > 0 && b == 1 ) {
System.out.println ("a = musbat toq son ");
} else if ( a > 0 && b == 0 ) {
System.out.println ("a = Musbat juft son ");
} else if ( a < 0 && b == 0 ) {
System.out.println ("a = Manfiy juft son ");
} else if ( a < 0 && b == -1 ) {
System.out.println ("a = manfiy toq son ");
} else {
System.out.println ("nolga teng");
}
}
}