FizzBuzz Download

Christina Cacioppo

strings, for loops, mods, if statements Student approved


Introduction

FizzBuzz is a famous programming question that companies used to interview software developers.


Task

Write a program that prints out numbers from 1 to 20 except:


Starter code

class Classic{
	public static void main(String[] args){
		fizzBuzz();
	}

	public static void fizzBuzz(){
		/*		Your code here		*/
	}
}

Expected output

1
2
"Fizz"
4
"Buzz"
"Fizz"
7
8
"Fizz"
"Buzz"
11
"Fizz"
13
14
"FizzBuzz"
16
17
"Fizz"
19
"Buzz"

One solution


Useful tools to solve the problem