Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created April 7, 2011 21:48
Show Gist options
  • Select an option

  • Save follesoe/908819 to your computer and use it in GitHub Desktop.

Select an option

Save follesoe/908819 to your computer and use it in GitHub Desktop.
public void FizzBuzz(int number)
{
// return FizzBuzz if Divisible by three and five
if(number % 3 == 0 && number % 5 == 0)
return "FizzBuzz";
return number;
}
public void FizzBuzz(int number)
{
if(IsDivisibleByTheeAndFive(number))
return "FizzBuzz";
return number;
}
private bool IsDivisibleByTheeAndFive(number)
{
return number % 3 == 0 && number % 5 == 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment