In this repo a common program called FizzBuzz is implemented in over 25 programming languages.
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.
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
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