Can You Crack This?

 

Ready to sharpen your coding skills? Whether you’re a beginner or a seasoned dev, this Code Challenge is a great way to stretch your logic muscles and have some fun along the way!

 Challenge: The FizzBuzz Twist

Write a program that prints numbers from 1 to 100, but with a twist:

  • For multiples of 3, print "Fizz" instead of the number.

  • For multiples of 5, print "Buzz" instead of the number.

  • For numbers which are multiples of both 3 and 5, print "FizzBuzz".

  • Here's the twist: For prime numbers, print "Prime" before any of the above rules.

🧠 Example Output:

1
Prime 2
Prime Fizz
4
Buzz
Fizz
Prime 7
8
Fizz
Buzz
Prime 11
Fizz

📌 Rules:

  • Use any programming language of your choice.

  • Optimize for readability and simplicity.

  • Bonus points if you can do it in under 15 lines of code!

📤 How to Participate:

  1. Write your solution.

  2. Share your code in the comments or tag me if posting on social media.

  3. Use the hashtag #CodeWithDarchums to connect with others!


💡 Tip: Use a helper function to check for prime numbers—it’ll make your code cleaner!

Let’s see how creative and clean your code can be. Happy coding! 💻🔥

#CodeChallenge #FizzBuzz #LearnToCode #DeveloperChallenge #100DaysOfCode #TechTips #DarchumsCodeChallenge

Comments