Skip to main content
← Back to Code Arena
Medium Apprentice SpeedRun loops modulo linq

FizzBuzz: Count the Fizzes

+150 XP · 10 min · attempt 1

Problem

Run the classic FizzBuzz from 1 to 100 (inclusive). For each n:
 - if divisible by 15 print "FizzBuzz"
 - else if divisible by 3 print "Fizz"
 - else if divisible by 5 print "Buzz"
 - else print n

How many lines of output contain the exact word "Fizz" (and only "Fizz")? Enter a single integer.

Starter

// var lines = Enumerable.Range(1,100).Select(n => /* ... */);
// Count lines that equal "Fizz".

Your answer

Log in to submit