Java DSA: Loops & Conditional Logic with FizzBuzz

🚀 Day 13 / 180 – DSA with Java 🚀 📘 Topic Covered: Loops & Conditional Logic 🧩 Problem Solved: FizzBuzz Problem: For numbers from 1 to n, return: • “Fizz” if divisible by 3 • “Buzz” if divisible by 5 • “FizzBuzz” if divisible by both • Otherwise, return the number itself Approach: Iterated from 1 to n, checked divisibility conditions, built the appropriate string dynamically, and stored the result in a list. Key Learning: ✔️ Strengthening control flow fundamentals ✔️ Handling multiple conditions cleanly ✔️ Writing simple yet structured logic If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #ProblemSolving #Consistency 

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories