Skip to main content

Command Palette

Search for a command to run...

Javascript Fizzbuzz

Updated
1 min read
Javascript Fizzbuzz
D

I am a Web Developer from Birtamode 1 Jhapa Nepal. As of 2022 i have 3 years of experience in CSS and 1 year of experience in Javascript + 6 Months of Experince in Node.js

FIZZBUZZ

Conditions

  • Print the Number 1-100
  • If the Number is divisible by 3 print FIZZ
  • if the Number is divisible by 5 print BUZZ
  • if the Number is divisible by both 3 and 5 print FIZZBUZZ

    Codes

    Javascript
    for(let i =0; i<=100;i++){
      if(i%3==0 && i%5!=0){
          console.log("fizz");
      }else if(i%5==0 && i%3!=0){
          console.log("buzz");
      }else if(i%5==0 && i%3==0){
          console.log("fizzbuzz");
      }else{
          console.log(i);
      }
    }
    

More from this blog

D

Dipesh Murmu

46 posts

A Full-Stack Laravel Developer with expertise in HTML, CSS, JavaScript, Tailwind, and core PHP. Leveraging the power of Laravel, I specialize in creating dynamic and responsive web applications.