Back to all tasks

Basic Divisibility Checker (FizzBuzz)

Your task is to implement a classic programming challenge known as FizzBuzz using Rust's fundamental control flow mechanisms. You need to iterate through numbers from 1 to 100, applying specific rules for printing based on divisibility.

  • For multiples of three, print "Fizz" instead of the number.
  • For multiples of five, print "Buzz" instead of the number.
  • For numbers which are multiples of both three and five, print "FizzBuzz".
  • For all other numbers, print the number itself.

Complete the main function provided to correctly implement this logic. Pay attention to Rust's loop syntax and conditional statements.

basic_divisibility_checker_(fizzbuzz).rs
Loading...

Use the "Verify Solution" button to get AI feedback on your rust code.