Programming is a highly sought-after skill in today’s digital world. Whether you’re looking to start a new career or simply expand your existing skillset, learning to code is an excellent way to open up new opportunities. One of the simplest, yet most impactful, programs you can write as a beginner is “Hello World”. This program serves as an introduction to the basic syntax and structure of a programming language.

In this comprehensive guide, we will show you how to print “Hello World” in 20 of the most popular programming languages. This will provide you with a foundational understanding of how different programming languages approach the task of printing a simple message on the screen. So, get ready to dive into the world of coding and let’s get started!

Printing `Hello World` in 20 Programming Languages

  1. Python

Python uses the print() method to print a string on the console. The string must in enclosed under double quotes.

  • Java

    Java uses the println() method is used to print content on the output console.

    public class HelloWorld {

        public static void main(String[] args) {

            System.out.println(“Hello World”);

        }

    }

  • C Programming

    In the C programming language, printf() function is used to print values on the output console.

    #include

    int main() {

        printf(“Hello World”);

        return 0;

    }

  • C Programming

    #include

    int main() {

        std::cout << “Hello World” << std::endl;

        return 0;

    }

  • Ruby
  • PHP

    <?php

        echo “Hello World”;

    ?>

  • JavaScript

    console.log(“Hello World”);

  • Swift
  • Go Programming

    package main

    import “fmt”

    func main() {

        fmt.Println(“Hello World”)

    }

  • Kotlin

    fun main(args: Array<String>) {

        println(“Hello World”)

    }

  • R Programming
  • Perl Programming
  • Scala

    object HelloWorld {

        def main(args: Array[String]) {

            println(“Hello World”)

        }

    }

  • Objective-C

    #import

    int main (int argc, const char * argv[]) {

        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

        NSLog (@“Hello World”);

        [pool drain];

        return 0;

    }

  • Shell Scripting
  • Assembly (x86) Programming

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    section .data

        msg db ‘Hello World’,0

    section .text

        global _start

    _start:

        ; write(1, msg, 12)

        mov eax, 4

        mov ebx, 1

        mov ecx, msg

        mov edx, 12

        int 0x80

        ; exit(0)

        mov eax, 1

        xor ebx, ebx

        int 0x80

  • SQL Statement
  • Rust Programming

    fn main() {

        println!(“Hello World”);

    }

  • TypeScript

    console.log(“Hello World”);

  • Lua Programming
  • Conclusion

    In conclusion, “Hello World” is a simple yet powerful program that helps beginners understand the basic syntax and structure of a new programming language. By printing “Hello World” in 20 popular programming languages, we hope to provide a comprehensive guide to help those new to the program understand how the syntax and structure of a program can vary between languages. Whether you are just starting out or looking to expand your skills, this guide serves as a valuable resource to help you get started. Regardless of the language you choose, the most important aspect is to keep practicing and building on your skills. Happy coding!