zohaib2002 / FizzBuzz

FizzBuzz implemented in over 25 programming languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FizzBuzz - In all programming languages

In this repo a common program called FizzBuzz is implemented in over 25 programming languages.

FizzBuzz

The FizzBuzz problem statement is as follows:

For numbers 1 through N, print "Fizz" if the number is divisible by 3, "Buzz" if it's divisible by 5, "FizzBuzz" if it's divisible by both 3 and 5, and the number itself otherwise.

Implementation Details

The logic / working of the program is kept as similar as possible accross all languages to make it easy to compare the implementation in different languages.

The Fizzbuzz program is chosen as it touches all the following aspects of a programming language.

  • I/O: Reading from and Writting to the Standard IO
  • Loops: Looping through the numbers
  • If Else Ladder: To check against different cases
  • Functions: Fizzbuzz is implemented as a seperate function
  • Arithmetic operations and comparisons

Programming Languages

FizzBuzz is implemented in the following languages

C, Clojure, C#, D, Dart, Elixir, F#, Go, Groovy, Haskell, Javascript, Java, Kotlin, Lisp, Lua, OCaml, Pascal, PHP, Perl, Python, R, Ruby, Racket, Rust, Scala, SQL, Swift

Feel free to contribute and add more languages

About

FizzBuzz implemented in over 25 programming languages


Languages

Language:C# 7.1%Language:Java 6.1%Language:Swift 4.8%Language:C 4.7%Language:HTML 4.2%Language:Rust 4.2%Language:Scala 3.8%Language:Pascal 3.7%Language:Elixir 3.7%Language:D 3.7%Language:PHP 3.5%Language:Common Lisp 3.4%Language:Dart 3.4%Language:Python 3.4%Language:F# 3.4%Language:Shell 3.4%Language:Kotlin 3.3%Language:Haskell 3.3%Language:Groovy 3.3%Language:Racket 3.3%Language:Lua 3.2%Language:R 3.2%Language:Go 3.1%Language:Perl 3.0%Language:OCaml 2.8%Language:Ruby 2.6%Language:Clojure 2.5%