-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort-array
More file actions
50 lines (26 loc) · 748 Bytes
/
Copy pathsort-array
File metadata and controls
50 lines (26 loc) · 748 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
40
41
42
43
44
45
46
47
48
49
50
/* Classic Interview question sorting your array, finding two modulous or more, and pertaining output */
import java.util.Scanner;
public class FizzBuzz {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter number");
double choice = input.nextDouble();
for (int i = 0; i <= choice; i++) {
switch(i % 35) {
case 0:
System.out.print("fizzbuzz ");
break;
case 5: case 10: case 15:
case 20: case 25: case 30:
System.out.print("Fizz ");
break;
case 7: case 14: case 21: case 28:
System.out.print("buzz ");
break;
default:
System.out.print(i + " ");
break;
}
}
}
}