DEV Community

prem Prema
prem Prema

Posted on

Hello World!

Title: Hello, World! in 12 Programming Languages
Introduction:
In this post, I’ve shared the "Hello, World!" example in 12 different programming languages. Whether you're a beginner or someone looking to explore different languages, this can be a handy reference to get started with basic syntax!

  1. Java
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}
Enter fullscreen mode Exit fullscreen mode
  1. Python
print("Hello, world!")
Enter fullscreen mode Exit fullscreen mode
  1. C
#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}
Enter fullscreen mode Exit fullscreen mode
  1. C++
#include <iostream>
using namespace std;

int main() {
    cout << "Hello, world!" << endl;
    return 0;
}
Enter fullscreen mode Exit fullscreen mode
  1. JavaScript
console.log("Hello, world!");
Enter fullscreen mode Exit fullscreen mode
  1. C#
using System;

class Program {
    static void Main() {
        Console.WriteLine("Hello, world!");
    }
}
Enter fullscreen mode Exit fullscreen mode
  1. Ruby
puts "Hello, world!"
Enter fullscreen mode Exit fullscreen mode
  1. Go
package main
import "fmt"

func main() {
    fmt.Println("Hello, world!")
}
Enter fullscreen mode Exit fullscreen mode
  1. Swift
print("Hello, world!")
Enter fullscreen mode Exit fullscreen mode
  1. PHP
<?php
echo "Hello, world!";
?>
Enter fullscreen mode Exit fullscreen mode
  1. HTML
<!DOCTYPE html>
<html>
  <body>
    Hello, world!
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode
  1. Kotlin
fun main() {
    println("Hello, world!")
}
Enter fullscreen mode Exit fullscreen mode

Conclusion:
These are just the simplest examples in each of these languages. If you’re just starting with a new language, this basic "Hello, World!" program is often your first step toward learning its syntax and structure.

You can also add tags like #programming, #code, #beginner, #java, #python, etc. to reach a wider audience.

😄

Top comments (0)