How to Print "Hello, World!" in the 20 Most Popular Programming Languages

The “Hello, World!” program is the first step for programmers to become acquainted with a new programming language. It’s considered to be one of the simplest programs possible in almost all languages.

In this article, you’ll learn how to write the “Hello, World!” program in the top 20 most popular programming languages.

What Is a “Hello, World!” Program?

A “Hello, World!” program is a computer program that outputs or displays the message “Hello, World!”. This simple program is used to illustrate the basic syntax of a programming language. A “Hello, World!” program is often the first program written by beginners when introduced to a new language.

It’s also used as a sanity test to make sure that a computer language is installed correctly. This is required because a lengthy and complex process is involved in configuring a programming language, therefore a simple program like “Hello, World!” is used as a first-run test on a new toolchain.

The following is a list of “Hello, world!” programs in the top 20 most popular programming languages.

1. “Hello, World!” Program in JavaScript

JavaScript is the world’s most popular coding language. It’s used both on the client-side and server-side and is called the programming language of the web.

Below is the “Hello, World!” program in JavaScript:

Output:

Hello, World!

2. “Hello, World!” Program in Python

Python is also one of the most popular programming languages. It’s used for web development, software development, mathematics, system scripting, etc.

Below is the “Hello, World!” program in Python:

print("Hello, World!")

Output:

Hello, World!

3. “Hello, World!” Program in Golang (Go)

Go is an open-source programming language developed by Google. Go provides many features like static typing, garbage collection, concurrency support, powerful standard library and toolset, testing capabilities, etc.

Below is the “Hello, World!” program in Golang (Go):

package main
import "fmt"

func main() {
fmt.Println("Hello, World!")
}

Output:

Hello, World!

4. “Hello, World!” Program in Java

Java is a high-level, class-based, and object-oriented programming language. Java is used in a variety of fields like mobile app development, desktop GUI applications, web-based applications, gaming applications, big data technologies, distributed applications, cloud-based applications, IoT applications, etc.

Below is the “Hello, World!” program in Java:

class HelloWorld {

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

Output:

Hello, World!

5. “Hello, World!” Program in Kotlin

Kotlin is a cross-platform, statically typed, general-purpose coding language with type inference. Kotlin is primarily used for android development.

Below is the “Hello, World!” program in the Kotlin programming language:

fun main(args: Array) {
println("Hello, World!")
}

Output:

Hello, World!

6. “Hello, World!” Program in PHP

PHP is an open-source scripting language. It’s used to develop websites and web apps. It’s so popular that about 79% of the websites are powered by PHP.

Related: How to Build Your First Simple PHP Website

Below is the “Hello, World!” program in PHP:








echo "Hello, World!";
?>


Output:

Hello, World!

7. “Hello, World!” Program in C#

C# was developed by Microsoft in 2000. It’s used to develop desktop applications, web applications, and web services. It’s also used in game development.

Related: Practical Reasons to Learn C# Programming

Below is the “Hello, World!” program in C#:

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

Output:

Hello, World!

8. “Hello, World!” Program in Swift

Swift was created by Apple in 2014. It’s a general-purpose programming language for the Apple ecosystem. Most iOS games you play or apps you use are written in React Native or Swift.

Below is the “Hello, World!” program Swift:

print("Hello, World!")

Output:

Hello, World!

9. “Hello, World!” Program in C++

C++ is a general-purpose object-oriented programming language created by Bjarne Stroustrup. It’s widely used to develop operating systems, browsers, games, etc.

Below is the “Hello, World!” program in the C++ programming language:

#include 
using namespace std;
int main()
{
cout return 0;
}

Output:

Hello, World!

10. “Hello, World!” Program in C

C is a powerful middle-level programming language developed by Dennis Ritchie. It’s used to develop software like operating systems, databases, compilers, etc.

Below is the “Hello, World!” program in C:

#include 

int main()
{
printf("Hello, World!");
return 0;
}

Output:

Hello, World!

11. “Hello, World!” Program in Matlab

MATLAB is a high-performance language for technical computing.

Below is the “Hello, World!” program in Matlab:

disp('Hello, World!');

Output:

Hello, World!

12. “Hello, World!” Program in R

R is a programming language for graphics and statistical computing. It’s widely used by statisticians and data miners.

Below is the “Hello, World!” program in the R programming language:

cat('Hello, World!')

Output:

Hello, World!

13. “Hello, World!” Program in Rub

Ruby is a general-purpose language primarily used for building web applications.

Related: The Best Interactive Introduction to Ruby for Newbies

Below is the “Hello, World!” program in Ruby:

puts "Hello, World!"

Output:

Hello, World!

14. “Hello, World!” Program in Rust

Rust is an open-source coding language that focuses on speed, memory safety, and parallelism.

Below is the “Hello, World!” program in Rust:

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

Output:

Hello, World!

15. “Hello, World!” Program in TypeScript

TypeScript was developed by Microsoft. TypeScript is a superset of JavaScript and is also popularly called “JavaScript for application-scale development”.

Below is the “Hello, World!” program in the TypeScript programming language:

let message: string = 'Hello, World!';
console.log(message);

Output:

Hello, World!

Related: The Best Programming Languages to Learn in 2021

16. “Hello, World!” Program in Perl

Perl is a general-purpose coding language used for text manipulation, system administration, web development, network programming, GUI development, etc.

Below is the “Hello, World!” program in Perl:

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

Output:

Hello, World!

17. “Hello, World!” Program in Scala

Scala is a high-level language that combines the features of object-oriented and functional programming in one language.

Below is the “Hello, World!” program in Scala:

object Hello {
def main(args: Array[String]) = {
println("Hello, World!")
}
}

Output:

Hello, World!

18. “Hello, World!” Program in Julia

Julia is a high-performance, high-level, open-source, dynamically-typed programming language. Julia was created by combining the powerful features of other programming languages like C, Ruby, Lisp, Matlab, Python, R, and Perl.

Below is the “Hello, World!” program in Julia:

println("Hello, World!")

Output:

Hello, World!

19. “Hello, World!” Program in Dart

Dart is a general-purpose, object-oriented, class-based, garbage-collected language with C-style syntax. It was created by Google in 2011. It’s used to create frontend user interfaces for the web and mobile apps. Nowadays it’s widely used to develop Flutter applications.

Below is the “Hello, World!” program in the Dart programming language:

void main() {
print('Hello, World!');
}

Output:

Hello, World!

20. “Hello, World!” Program in Solidity

Solidity is a statically-typed curly-braces language designed for developing smart contracts that run on Ethereum.

Below is the “Hello, World!” program in Solidity:

pragma solidity ^0.4.22;
contract helloWorld {
function renderHelloWorld () public pure returns (string) {
return 'Hello, World!';
}
}

Output:

Hello, World!

Start Your Coding Journey With Python

Python provides many useful features like easy to code, object-oriented language, GUI programming support, high-level language, extensible feature, portable language, integrated language, etc. which makes it the first choice for beginners to get started with programming.

Python is among the most popular programming languages in the world today. If you’re looking to start your coding journey, Python is the best choice to get started.

Source: makeuseof.com

Related posts

5 Major Features of the 11-Inch and 13-Inch iPad Air 2024 Models

This App Lets Anyone Draw Like a Pro

The 5 Biggest Features and Changes in Apple’s OLED iPad Pros