-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx16.java
More file actions
39 lines (30 loc) · 733 Bytes
/
Copy pathEx16.java
File metadata and controls
39 lines (30 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
29
30
31
32
33
34
35
36
37
38
39
package listaexercicios2;
import java.util.Scanner;
public class Ex16 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n;
System.out.println("Digite um valor: ");
n = sc.nextInt();
int n1=n+10;
do {
n++;
if (n==0) {
System.out.println("Nulo" + " - " + n);
}
if (n%2==0 && n!=0) {
System.out.println("Número Par" + " - " + n);
}
if (n%2!=0 && n!=0) {
System.out.println("Número ímpar" + " - " + n);
}
if (n<0) {
System.out.println("Número negativo");
}
if (n>0) {
System.out.println("Número positivo");
}
} while ((n<=n1));
}
}