-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBreakEContinue.java
More file actions
75 lines (51 loc) · 1.25 KB
/
BreakEContinue.java
File metadata and controls
75 lines (51 loc) · 1.25 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.laiane.cursojava.aula18;
import java.util.Scanner;
public class BreakEContinue {
public static void main(String[] args) {
/*Scanner scan = new Scanner(System.in);
System.out.println("Entre com um número");
int num = scan.nextInt();
System.out.println("Entre com um limite");
int max = scan.nextInt();
for (int i=num; i<=max; i++){
System.out.println(i);
if (i % 7 ==0){
System.out.println("O valor de i é: " +i);
break;
}
}*/
/*for (int i=0; i<=4; i++) {
rotulo1: {
rotulo2: {
rotulo3: {
if (i ==1){
break rotulo1;
}
if (i == 2){
break rotulo2;
}
if (i == 3) {
break rotulo3;
}
System.out.println("rotulo3");
}
System.out.println("rotulo2");
}
System.out.println("rotulo1");
}
System.out.println(i);
}*/
Scanner scan = new Scanner(System.in);
System.out.println("Entre com um número");
int num = scan.nextInt();
System.out.println("Entre com um limite");
int max = scan.nextInt();
for (int i=num; i<=max; i++){
System.out.println(i);
if (i % 7 ==0){
continue;
}
System.out.println("O valor de i é: " +i);
}
}
}