Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Question FizzBuzz
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { //Complete the implementation of this method //For the given input the following must happen: // -> If the input value is divisable by 3 print "fizz" // -> If the input value is divisable by 5 print "buzz" // -> If the input value is divisable by 3 & 5 print "fizzbuzz" // -> If the input value is not divisable by 3 or 5 print "PING" public static String fizzBuzz(int input) { } public static void main(String args[]) { System.out.println(fizzBuzz(3)); System.out.println(fizzBuzz(5)); System.out.println(fizzBuzz(8)); System.out.println(fizzBuzz(15)); System.out.println(fizzBuzz(30)); System.out.println(fizzBuzz(35)); System.out.println(fizzBuzz(105)); } }
run
|
edit
|
history
|
help
0
polymorphic mapper
kochergina_3
++a vs a++ and calculations around different variables
move zeros to end of array
find Kth largest element in array
Municipiu_Problema_2_Palindrome
your age
t-primes
Increment
Quadratic equation