How to print “Hello, World!” in the 20 most popular programming languages

0

The “Hello, World!” program is the first step in familiarizing programmers with a new programming language. It is considered to be one of the simplest programs possible in almost any language.

In this article, you will 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 generates 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 they are introduced to a new language.

It is also used as an integrity test to ensure that a computer language is correctly installed. This is necessary because a long and complex process is involved in setting up a programming language, hence 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 20 most popular programming languages.

1. “Hello, World!” JavaScript program

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

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

Production:

Hello, World!

2. “Hello, World!” Program in Python

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

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

print("Hello, World!")

Production:

Hello, World!

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

Go is an open source programming language developed by Google. Go provides a lot of features like static typing, garbage collection, concurrency support, a powerful standard library and a set of tools, testing capabilities, and more.

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

package main
import "fmt"

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

Production:

Hello, World!

4. “Hello, World!” Program in Java

Java is a high-level, class-based, object-oriented programming language. Java is used in various fields such as mobile application development, desktop GUI applications, web 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!");
}
}

Production:

Hello, World!

5. “Hello, World!” Program at Kotlin

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

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

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

Production:

Hello, World!

6. “Hello, World!” Program in PHP

PHP is an open source scripting language. It is used to develop websites and web applications. It is so popular that around 79% of 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!";
?>


Production:

Hello, World!

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

C # was developed by Microsoft in 2000. It is used to develop desktop applications, web applications, and web services. It is 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!");
}
}
}

Production:

Hello, World!

8. “Hello, World!” Program in Swift

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

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

print("Hello, World!")

Production:

Hello, World!

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

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

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

#include 
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}

Production:

Hello, World!

10. “Hello, World!” Program in C

It is a powerful mid-level programming language developed by Dennis Ritchie. It is used to develop software such as operating systems, databases, compilers, etc.

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

#include 

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

Production:

Hello, World!

11. “Hello, World!” Matlab program

MATLAB is a high performance language for technical computing.

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

disp('Hello, World!');

Production:

Hello, World!

12. “Hello, World!” Program in R

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

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

cat('Hello, World!')

Production:

Hello, World!

13. “Hello, World!” Program in Rub

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

Related: The Best Interactive Intro To Ruby For Beginners

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

puts "Hello, World!"

Production:

Hello, World!

14. “Hello, World!” Rust program

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

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

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

Production:

Hello, World!

15. “Hello, World!” Program in TypeScript

TypeScript was developed by Microsoft. TypeScript is a superset of JavaScript and is also commonly referred to as “JavaScript for application-wide development”.

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

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

Production:

Hello, World!

Related: The Best Programming Languages ​​To Learn In 2021

16. “Hello, world!” Perl program

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

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

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

Production:

Hello, World!

17. “Hello, World!” Program in Scala

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

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

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

Production:

Hello, World!

18. “Hello, World!” Julia program

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

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

println("Hello, World!")

Production:

Hello, World!

19. “Hello, World!” Dart program

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

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

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

Production:

Hello, World!

20. “Hello, World!” Solidity program

Solidity is a static-like curly brace language designed for developing smart contracts that run on Ethereum.

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

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

Production:

Hello, World!

Start your coding journey with Python

Python provides many useful features like ease of coding, object oriented language, support for GUI programming, high level language, extensible functionality, portable language, embedded language, etc. which makes it the first choice for beginners to get started in programming.

Python is one of the most popular programming languages ​​in the world today. If you are looking to start your coding journey, Python is the best choice to start.


Person coding on laptop
How to get started with Python using a “Hello World” script

Python is one of the most used programming languages ​​today. Follow this tutorial to get started with your very first Python script.

Read more


About the Author

.


Source link

Share.

About Author

Leave A Reply