Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»The “Hello World” Challenge: Printing in 20 Different Programming Languages

    The “Hello World” Challenge: Printing in 20 Different Programming Languages

    By RahulFebruary 7, 20232 Mins Read

    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.

    Advertisement

    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
    2. Python uses the print() method to print a string on the console. The string must in enclosed under double quotes.

      1
      print("Hello World")

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

      1
      2
      3
      4
      5
      public class HelloWorld {
          public static void main(String[] args) {
              System.out.println("Hello World");
          }
      }

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

      1
      2
      3
      4
      5
      6
      #include<stdio.h>
       
      int main() {
          printf("Hello World");
          return 0;
      }

    7. C++ Programming
    8. 1
      2
      3
      4
      5
      6
      #include<iostream>
       
      int main() {
          std::cout << "Hello World" << std::endl;
          return 0;
      }

    9. Ruby
    10. 1
      puts "Hello World"

    11. PHP
    12. 1
      2
      3
      <?php
          echo "Hello World";
      ?>

    13. JavaScript
    14. 1
      console.log("Hello World");

    15. Swift
    16. 1
      print("Hello World")

    17. Go Programming
    18. 1
      2
      3
      4
      5
      6
      7
      package main
       
      import "fmt"
       
      func main() {
          fmt.Println("Hello World")
      }

    19. Kotlin
    20. 1
      2
      3
      fun main(args: Array<String>) {
          println("Hello World")
      }

    21. R Programming
    22. 1
      cat("Hello World")

    23. Perl Programming
    24. 1
      print "Hello World\n";

    25. Scala
    26. 1
      2
      3
      4
      5
      object HelloWorld {
          def main(args: Array[String]) {
              println("Hello World")
          }
      }

    27. Objective-C
    28. 1
      2
      3
      4
      5
      6
      7
      8
      #import <Foundation/Foundation.h>
       
      int main (int argc, const char * argv[]) {
          NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
          NSLog (@"Hello World");
          [pool drain];
          return 0;
      }

    29. Shell Scripting
    30. 1
      echo "Hello World"

    31. Assembly (x86) Programming
    32. 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

    33. SQL Statement
    34. 1
      SELECT 'Hello World';

    35. Rust Programming
    36. 1
      2
      3
      fn main() {
          println!("Hello World");
      }

    37. TypeScript
    38. 1
      console.log("Hello World");

    39. Lua Programming
    40. 1
      print("Hello World")

    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!

    example hello world
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    PHP Arrays: A Beginner’s Guide

    How to Create and Read List in Python

    Python Program to Add Two Numbers

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Configure Postfix to Use Gmail SMTP on Ubuntu & Debian
    • PHP Arrays: A Beginner’s Guide
    • Deploying Flask Application on Ubuntu (Apache+WSGI)
    • OpenSSL: Working with SSL Certificates, Private Keys and CSRs
    • How to Create and Read List in Python
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.