Calculating the sum from one to a billion in different programming languages, inspired by @leachim6/hello-world
The following implementations need to be reviewed:
- APL
- C
- C++
- C#
- Cuda
- Go
- Haskell
- Java
- JavaScript
- Julia
- Kotlin
- Lisp
- Mathematica
- Perl
- PHP
- R
- Python
- Ruby
- Rust
- Scala
- Shell
- SML
- Swift
The code should be fully runnable. (The following example is Swift) NOT:
var sum = 0
for i in 1...1000000000 {
sum += i
}
print (sum)
Instead do:
class ViewController: UIViewController {
func viewDidLoad() {
var sum = 0
for i in 1...1000000000 {
sum += i
}
print (sum)
}
}