Assignemnt #85 Fizz Buzz
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Fizz Buzz
///File Name: Fizz.java
public class Fizz
{
public static void main( String[] args )
{
for ( int n=1; n<=100; n=n+1)
{
if ( n%3==0)
{
System.out.println( "Fizz ");
}
if (n%5==0)
{
System.out.println( "Buzz ");
}
if (n%3==0 && n%5==0)
{
System.out.println( "FizzBuzz ");
}
else
{
System.out.println( "" + n + " ");
}
}
}
}
Picture of Output
// Couldn't fit it all in one screen shot so I just took a pic of the last couple lines