Skip to content

Commit

Permalink
Reto #0 - Fuzzbuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
vandresca committed Jul 30, 2023
1 parent 24ec6ae commit 676cf18
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/java/vandresca.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Listar los números del 1 al 100 ambos incluidos
* Si el número es múltiplo de 3 sustituir por la palabra 'fizz'
* Si el número es múltiplo de 5 sustituir por la palabra 'buzz'
* Si el número es múltiplo de 3 y 5 sustituir por la palabra 'fizzbuzz'
*/
public class vandresca {
public static void main(String[] args) {
for(int i = 0; i<100; i++){
if(i%15==0) System.out.println("fizzbuzz");
else if(i%3==0) System.out.println("fizz");
else if(i%5==0) System.out.println("buzz");
else System.out.println(i);
}
}
}

0 comments on commit 676cf18

Please sign in to comment.