Initial Commit

This commit is contained in:
Emma Nora Theuer 2024-09-04 12:55:46 +02:00
parent 8cdd432209
commit 8644842962

20
fizzbuzz.java Normal file
View file

@ -0,0 +1,20 @@
public class fizzbuzz{
public static void main(String[] args) {
Integer i = 1;
while (true) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.println("fizzbuzz");
i++;
} else if (i % 3 == 0) {
System.out.println("fizz");
i++;
} else if (i % 5 == 0) {
System.out.println("buzz");
i++;
} else {
System.out.println(i);
i++;
}
}
}
}