"Hello World" in 10 Languages

rakeshkr2

Rakesh KR

Posted on December 5, 2022

"Hello World" in 10 Languages

Hello World 👋🌍

Let's go through the "Hello World" syntax in 10 languages 🐱‍💻.

Feel free to comment ✍️ your first 🥇 "Hello World" language.

1. Java

class Main {
    public static void main(String[] args){
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

2. C

#include<stdio.h>
int main(){
printf("Hello World");
return 0;
}
Enter fullscreen mode Exit fullscreen mode

3. C++

#include<iostream>
int main (){
  std::cout << "Hello World";
  return 0;
}
Enter fullscreen mode Exit fullscreen mode

4. C#

public class Hello{
  public static void Main(String[] args){
    System.Console.WriteLine("Hello World");
  }
}
Enter fullscreen mode Exit fullscreen mode

5. Python

print("Hello World")
Enter fullscreen mode Exit fullscreen mode

6. JS

console.log("Hello World");

alert("Hello World");

document.write("Hello World");
Enter fullscreen mode Exit fullscreen mode

7. GO

package main
import "fmt"

func main(){
    fmt.Println("Hello World")
}
Enter fullscreen mode Exit fullscreen mode

8. Kotlin

func main(){
    println("Hello World")
}
Enter fullscreen mode Exit fullscreen mode

9. PHP

<?php
echo "Hello World";
?>
Enter fullscreen mode Exit fullscreen mode

10. Swift

import Swift
print("Hello World")
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
rakeshkr2
Rakesh KR

Posted on December 5, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related