Assignemnt #84
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: fizbuz Program
/// File Name: fizbuz.java
/// Date Finished: 9/9/2015
import java.util.Scanner;
import java.util.Random;
public class fizbuz
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String say = "";
for ( int n = 0 ; n <= 100 ; n++ )
{
if (n % 2 == 0 && n % 3 == 0)
System.out.println("FizzBuzz");
if (n % 2 == 0)
System.out.println("Fizz");
else if (n % 3 == 0)
System.out.println("Buzz");
else
System.out.println(n);
}
System.out.println("");
}
}
Picture of the output