aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
  • Tools
  • About
  • Software Engineering

How To Say “Hello World” In 23 Programming Languages

  • relay
  • February 27, 2023
  • 2 minute read

In the world of programming, “Hello World” is often the first program developers write when they start learning a new language. This simple program outputs the phrase “Hello, World!” to the screen, and while it may seem like a trivial exercise, it serves as a great starting point for anyone learning a new programming language. But with so many programming languages out there, have you ever wondered what “Hello World” looks like in all of them?

In this article, we’ll explore the top 23 programming languages and take a look at how to write a “Hello World” program in each one. Whether you’re an experienced developer or just starting out, this article will provide an interesting glimpse into the similarities and differences between some of the most popular programming languages used today.

01. Python

print('Hello, world!')

02. C

#include <stdio.h>
int main() {
  printf("Hello, World!");
  return 0;
}

03 C++

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

04. Java

class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, World!"); 
  }
}

05. C#

namespace HelloWorld
{
  class Hello {         
    static void Main(string[] args)
    {
      System.Console.WriteLine("Hello World!");
    }
  }
}

06. Visual Basic

Imports System

Module Module1
  Sub Main()
    Console.WriteLine("Hello World!")
    Console.WriteLine("Press Enter Key to Exit.")
    Console.ReadLine()
  End Sub
End Module

07. JavaScript

console.log('Hello World');

08. SQL

CREATE TABLE helloworld (phrase TEXT);
INSERT INTO helloworld VALUES ("Hello, World!");
SELECT * FROM helloworld;

09. Assembly Language

global    _start
 
          section   .text
_start:   mov       rax, 1                  ; system call for write
          mov       rdi, 1                  ; file handle 1 is stdout
          mov       rsi, message            ; address of string to output
          mov       rdx, 13                 ; number of bytes
          syscall                           ; invoke operating system to do the write
          mov       rax, 60                 ; system call for exit
          xor       rdi, rdi                ; exit code 0
          syscall                           ; invoke operating system to exit
 
          section   .data
message:  db        "Hello, World", 10      ; note the newline at the end

10. PHP

<!DOCTYPE html>
<html>
<body>
 
<h1>My first PHP page</h1>
 
<?php
echo "Hello World!";
?>
 
</body>
</html>

11. Swift

print("Hello, world!")

12. Go

package main
 
import "fmt"
 
func main() {
    fmt.Println("hello world")
}

13. R

print("Hello World!")

14. Classic Visual Basic

Imports System
 
Module Module1
  Sub Main()
    Console.WriteLine("Hello World!")
    Console.WriteLine("Press Enter Key to Exit.")
    Console.ReadLine()
  End Sub
End Module

15. MATLAB

function y = hello_world 
%#codegen
y = 'Hello World!';

16. Ruby

puts "Hello World"

17. Rust

fn main() {
  println!("Hello World!");
}

18. Scala

@main def hello() = println("Hello, World!")

19. Perl

#!/usr/bin/perl
use warnings;
print("Hello, World!\n");

20. Scratch

say Hello World!

21. (Visual) FoxPro

Messagebox("Hello World!",64)
? "Hello World"

22. SAS

proc ds2 libs=work;
data _null_;
 
  /* init() - system method */
  method init();
    declare varchar(16) message; /* method (local) scope */
    message = 'Hello World!';
    put message;
  end;
enddata;
run;
quit;

23. Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSLog (@"Hello, World!");
    [pool drain];
    return YES;
 
}

Source: Cyberpogo

Read More  Announcing Serverless Spark Components For Vertex AI Pipelines
relay

Related Topics
  • Hello World
  • programming languages
You May Also Like
View Post
  • Engineering
  • Software Engineering

My First Pull Request At Age 14

  • March 24, 2023
View Post
  • Practices
  • Software Engineering

Pythonic Techniques For Handling Sequences

  • March 21, 2023
View Post
  • Software Engineering

Eclipse Java Downloads Skyrocket

  • March 19, 2023
View Post
  • Software
  • Software Engineering
  • Tools

How To Use Bash

  • March 17, 2023
View Post
  • Software Engineering

Ballerina: A Programming Language For The Cloud

  • March 16, 2023
View Post
  • Engineering
  • People
  • Software Engineering

A Guide To Managing Your Agile Engineering Team

  • March 15, 2023
View Post
  • Software
  • Software Engineering

Python 3.12.0 Alpha 6 Released

  • March 15, 2023
View Post
  • Software Engineering

7 Awesome JavaScript Projects To Check Out Today

  • March 10, 2023

Stay Connected!
LATEST
  • 1
    My First Pull Request At Age 14
    • March 24, 2023
  • 2
    AWS Chatbot Now Integrated Into Microsoft Teams
    • March 24, 2023
  • 3
    Verify POST Endpoint Availability With Uptime Checks
    • March 24, 2023
  • 4
    Sovereign Clouds Are Becoming A Big Deal Again
    • March 23, 2023
  • 5
    Ditching Google: The 3 Search Engines That Use AI To Give Results That Are Meaningful
    • March 23, 2023
  • 6
    Pythonic Techniques For Handling Sequences
    • March 21, 2023
  • 7
    Oracle Cloud Infrastructure to Increase the Reliability, Efficiency, and Simplicity of Large-Scale Kubernetes Environments at Reduced Costs
    • March 20, 2023
  • 8
    Monitor Kubernetes Cloud Costs With Open Source Tools
    • March 20, 2023
  • 9
    What Is An Edge-Native Application?
    • March 20, 2023
  • 10
    Eclipse Java Downloads Skyrocket
    • March 19, 2023
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • 1
    Cloudflare Takes On Online Fraud Detection Market
    • March 15, 2023
  • 2
    Linux Foundation Training & Certification & Cloud Native Computing Foundation Partner With Corise To Prepare 50,000 Professionals For The Certified Kubernetes Administrator Exam
    • March 16, 2023
  • 3
    Cloudflare Democratizes Post-Quantum Cryptography By Delivering It For Free, By Default
    • March 16, 2023
  • 4
    Daily QR “Scan Scams” Phishing Users On Their Mobile Devices
    • March 16, 2023
  • 5
    Lockheed Martin Launches Commercial Ground Control Software For Satellite Constellations
    • March 14, 2023
  • /
  • Platforms
  • Architecture
  • Engineering
  • Programming
  • Tools
  • About

Input your search keywords and press Enter.