Intro๐๐พ
"Hello world!" is the first thing you know how to write when jumping on a new programming language. In this article, we are going to see how to say Hello World in some programming languages existing out there.
1. Pascal
{Hello world in Pascal}
program HelloWorld(output);
begin
WriteLn('Hello World!');
end.
2. C
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("Hello World");
}
3. Php
<?php
echo "Hello world!";
?>
4. Python
print("Hello world!")
5. Scala
// Hello world in Scala
object HelloWorld extends App {
println("Hello world!")
}
6. Java
// Hello World in Java
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}
7. JavaScript
console.log("Hello World");
8. Rust
// Hello world in Rust
fn main() {
println!("Hello World!");
}
9. Haskell
-- Hello World in Haskell
main = putStrLn "Hello World"
10. Ruby
# Hello World in Ruby
puts "Hello World!"
11. Go
// Hello world in Go
package main
import "fmt"
func main() {
fmt.Printf("Hello World\n")
}
12. R
# Hello World in R
cat("Hello world\n")
13. Swift
// Hello world in Swift
println("Hello, world!")
14. Unix shell
# Hello world for the Unix shells (sh, ksh, csh, zsh, bash, fish, xonsh, ...)
echo Hello World
15. Dart
// Hello world in Dart
main() {
print('Hello world!');
}
16. Perl
# Hello world in perl
print "Hello World!\n";
17. C#
//Hello World in C#
class HelloWorld
{
static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
18. F#
(* Hello World in F# *)
printf "Hello World!\n"
I hope you've seen the way we can say Hello World in different ways. โจ
ย