-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
63 lines (48 loc) · 1.19 KB
/
HelloWorld.java
File metadata and controls
63 lines (48 loc) · 1.19 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
import java.util.*;
class HelloWorld {
public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
/*int num = sc.nextInt();
if(num % 3 == 0 && num % 5 == 0){
System.out.print("Fizz-Buzz");
}
else if(num % 3 == 0){
System.out.print("Fizz");
}
else if(num % 5 == 0){
System.out.print("Buzz");
}*/
/*Scanner sc = new Scanner(System.in);
System.out.print("do you want to adopt a dog? -yes/no");
String adopt = sc.next();
if (adopt.equalsIngnoreCase( "yes")) {
System.out.print("what size of dog do you prefer? -large/medium/small");
String s1 = sc.next();
System.out.print("Do you live in cold place? -yes/no");
String cold = sc.next();
if(s1.eqals("small")){
if(cold.equals("yes"))
System.out.print("shih tzu");
} else{
System.out.print("beagle");
}
if(s1.eqals("medium")){
int a = 1;
while(a < 100){
System.out.println(a);
a = a + 1;
}
int b = 100;
while(b >= 1){
System.out.println(b);
b = b - 1;*/
int a = sc.nextInt();
int b = sc.nextInt();
int i = a;
while(i <= b){
if(i % 2 == 0){
System.out.print(i + " ");
}
i++; }
}
}