Interview Question

Software Developer Interview San Francisco, CA

Program the game FizzBuzz for numbers 1-100 in any

  programming language.
Answer

Interview Answer

3 Answers

0

Answer to this question is here
http://www.algopill.com/2011/03/13/fizzbuzz/

AlgoPill on Mar 13, 2011
0

for(int i=0;i<100;i++){
    if(i%15==0){
        System.out.println("fizzbuzz");
    }else if(i%3==0){
        System.out.println("fizz");
    }else if(i%5==0){
        System.out.println("buzz");
    }else{
        System.out.println(i);
    }
}

Anonymous on Jun 16, 2013
0

def fizzBuzz():
  for val in range(1, 101):
    if val % 15 == 0:
      print "FizzBuzz"
    elif val % 3 == 0:
      print "Fizz"
    elif val % 5 == 0:
      print "Buzz"
    else:
      print val

Anonymous on Oct 7, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.