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
heeeeell
Sample for https://stackoverflow.com/a/49984959/4216641
// Java Coding Challenge - 08: Reversing a Number using String
Write a program to sort the odd elements descending order and even elements in ascending order
Validate BST
piglatin
Vasanth Selvaraj
JavaScript on Java's System.out.println()
Memory cleanup
// Java Coding Challenge - 09: Find out duplicate numbers using Array