Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

“Hello World” In 30 Different Languages

  • Difficulty Level : Basic
  • Last Updated : 14 Aug, 2021

In this article, we are going to see how to print “Hello World” in 30 different languages. It includes languages like C, C++, Cobol, Scala, Matlab, C#, CoffeeScript, Delphi, Dart, Haskell, Pascal, Ruby, Python, Assembly, R, Swift, Kotlin, PHP, Java, Go, F#, Lisp, JavaScript, Algol, Perl, Tcl, TypeScript, Fortran, Bash (Unix Shell) and HTML.

Now, let’s get started,

1. C Language

C is a procedural programming language. It was initially developed by Dennis Ritchie as a system programming language to write an operating system. 

Features:

  • Include low-level access to memory, a simple set of keywords, and a clean style, these features make C language suitable for system programmings like operating system or compiler development.
  • Fast and Efficient.

Hello World Program in C Language:



C




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

2. C++ Language

C++, high-level computer programming language. Developed by Bjarne Stroustrup of Bell Laboratories in the early 1980s, it is based on the traditional C language but with added object-oriented programming and other capabilities. 

Features:

  • Machine Independent or Portable.
  • Mid-level programming language. 

Hello World Program in C++: 

C++




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

3. Cobol Language

COBOL was designed in 1959 by CODASYL and was partly based on the programming language FLOW-MATIC designed by Grace Hopper. It was created as part of a US Department of Defense effort to create a portable programming language for data processing.

Features:

  • COBOL is an easy-to-learn, standard language that can be compiled and executed on a variety of computers. It supports a wide syntax vocabulary and features an uncluttered coding style.
  • The logical control structures available in COBOL make it easy to read, modify and debug. COBOL is also scalable, reliable and portable across platforms.

Hello World Program in Cobol:

IDENTIFICATION DIVISION.
PROGRAM-ID. Hello-world.
PROCEDURE DIVISION.
    DISPLAY "Hello World".    .

4. Scala Language

Scala is a modern programming language designed and created by Martin Odersky. The design of the language started in 2001 and was released to the public in early 2004. Martin Odersky had a huge hand in the implementation of javac (the primary Java compiler) and also designed Generic Java, a facility of generic programming that was added to the Java programming language in 2004. This is why it doesn’t come as a surprise that Scala is similar to Java in many aspects, it’s actually written to run in JVM (Java Virtual Machine).

Features:



  • Case classes and Pattern matching.
  • Singleton object.

Hello World Program in Scala:

Scala




object HelloWorld extends App {
    printIn("Hello World")
}

  

5. Matlab Language

MATLAB is a programming language developed by MathWorks. It started out as a matrix programming language where linear algebra programming was simple. It can be run both under interactive sessions and as a batch job. This tutorial gives you aggressively a gentle introduction of MATLAB programming language.
 

Features:

  • MATLAB can natively support the sensor, video, image, telemetry, binary, and various real-time data from JDBC/ODBC databases. Reading data from different databases, CSV, audio, images, and video is super simple from an integrated environment.
  • It offers a huge library of mathematical functions needed for computing statistics, linear algebra, numerical integration, filtering, Fourier analysis, optimization and solving regular differential equations. 

Hello World Program in Matlab: 

disp('Hello World');

7. C# Language

C# is pronounced as “C-Sharp”. It is an object-oriented programming language provided by Microsoft that runs on .Net Framework. Anders Hejlsberg is known as the founder of C# language. It is based on C++ and Java, but it has many additional extensions used to perform component-oriented programming approach. C# has evolved much since their first release in the year 2002. It was introduced with .NET Framework 1.0 and the current version of C# is 5.0. 

Features:

  • Type-Safe.
  • Component Oriented.

Hello World in C#:

C#




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

  



7. CoffeeScript Language

CoffeeScript is a lightweight language based on Ruby and Python which transcompiles (compiles from one source language to another) into JavaScript. It provides better syntax avoiding the quirky parts of JavaScript, still retaining the flexibility and beauty of the language.

Features:

  • Class-Based Inheritance.
  • Extensive Library Support.
     

Hello World in CoffeeScript:

console.lof 'Hello World'

8. Delphi Language

Delphi was built to be run with Windows, macOS, iOS, Android, and Linux applications. This is about every major platform in existence. Primarily though, it was developed to be run with Windows-based applications. Since its arrival, Delphi has emphasized backward compatibility. This means that new programs can be run with their successors seamlessly.

Features:

  • Backward Compatibility.
  • Incorporation Capability.

Hello World Program in Delphi:

program HelloWorld;
begin
  WriteLn('Hello World');
end.

9. Dart Language

Dart is an open-source general-purpose programming language. It is originally developed by Google and later approved as a standard by ECMA. Dart is a new programming language meant for the server as well as the browser. Introduced by Google, the Dart SDK ships with its compiler – the Dart VM. The SDK also includes a utility -dart2js, a transpiler that generates JavaScript equivalent of a Dart Script.

Features:

  • Flexible Imports and Exports.
  • Null-Safe Operators.

Hello World in Dart:

Dart






main(){
    print('Hello World');
}

10. Haskell Language

Haskell is a widely used purely functional language. Functional programming is based on mathematical functions. Besides Haskell, some other popular languages that follow Functional Programming paradigm include: Lisp, Python, Erlang, Racket, F#, Clojure, etc. Haskell is more intelligent than other popular programming languages such as Java, C, C++, PHP, etc

Features:

  • Lazy Evaluation.
  • Pattern Matching.
     

Hello World in Haskell:

module Main where

main :: IO ()
main = putStrLn "Hello World"

11. Pascal Language

Pascal, a computer programming language developed about 1970 by Niklaus Wirth of Switzerland to teach structured programming, which emphasizes the orderly use of conditional and loop control structures without GOTO statements.

Features:

  • Pascal is a Strongly Typed Language.
  • It Supports Structured Programming Through Functions and Procedures. 

Hello World in Pascal:

program Hello;
begin
  writeln ('Hello, world.');
end.

12. Ruby Language

Ruby is a pure object-oriented programming language. It was created in 1993 by Yukihiro Matsumoto of Japan. Ruby is open-source and is freely available on the Web, but it is subject to a license.  

Features:

  • Ruby can be used to write Common Gateway Interface (CGI) scripts.
  • Ruby can be embedded into Hypertext Markup Language (HTML).

 Hello World in Ruby:

Ruby






puts 'Hello World'

  

13. Python Language

Python is a widely-used, interpreted, object-oriented, and high-level programming language with dynamic semantics, used for general-purpose programming. It was created by Guido van Rossum, and first released on February 20, 1991. 

Features:

  • GUI Programming Support.
  • Dynamically Typed Language.
     

Hello World in Python:

Python3




print("Hello World")

  

14. Assembly Language

Stan Poley wrote the Symbolic Optimal Assembly Program or SOAP assembly language for the IBM 650 computer in 1955. Assembly languages started being used widely as they relieved the programmers from tedious tasks such as remembering numeric codes. 

Features:

  • 64-bit Address Space.
  • Assembly languages have a syntax that is similar to the English language.
     

Hello World in Assembly Language:

    global _main
    extern _printf

    section .text
_main:
    push    message
    call    _printf
    add        esp, 4
message:
    db    'Hello World', 10, 0

15. R Language

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. 

Features:



  • Can Perform Complex Statistical Calculations.
  • R is an interpreted language which means that it does not need a compiler to make a program from the code.

Hello World Program in R:

R




cat('Hello World')

16. Swift Language

Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative, and block structured language. It is the result of the latest research on programming languages and is built using a modern approach to safety, software design patterns by Apple Inc.. It is the brand new programming language for the iOS application, macOS applications, watchOS applications, tvOS applications.

Features:

  • Closures unified with function pointers.
  • Fast and concise iteration over a range or collection.

Hello World in Swift:

println('Hello World');

17. Kotlin Language

Kotlin is a statically typed, general-purpose programming language developed by JetBrains, that has built world-class IDEs like IntelliJ IDEA, PhpStorm, Appcode, etc. It was first introduced by JetBrains in 2011 and a new language for the JVM. Kotlin is an object-oriented language, and a “better language” than Java, but still be fully interoperable with Java code. 

Features:

  • Functions and functional programming.
  • Top-level objects and the Singleton pattern. 

Hello World in Kotlin:

Kotlin




fun main(args: Array<String>){
    println("Hello World")
}

18. PHP Language

PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994. PHP is a recursive acronym for “PHP: Hypertext Preprocessor”. PHP is a server-side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. 



Features:

  • Loosely Typed Language.
  • Error Reporting.

Hello World in PHP:

PHP




echo "Hello World";

19. Java Language

Java was created at Sun Microsystems, Inc., where James Gosling led a team of researchers in an effort to create a new language that would allow consumer electronic devices to communicate with each other. Work on the language began in 1991, and before long the team’s focus changed to a new niche, the World Wide Web. Java was first released in 1995, and Java’s ability to provide interactivity and multimedia showed that it was particularly well suited for the Web.
 

Features:

  • Multi-Threaded.
  • High Performance. 

Hello World in Java:

Java




/*package whatever //do not write package name here */
 
import java.io.*;
 
class GFG {
    public static void main (String[] args) {
       System.out.println("Hello World");
    }
}

20. Go Language

Go language is a programming language initially developed at Google in the year 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is a statically-typed language having syntax similar to that of C. It provides garbage collection, type safety, dynamic-typing capability, many advanced built-in types such as variable length arrays and key-value maps.

Features:

  • Powerful Standard Library and Tool Set.
  • Testing Capabilities.

Hello World in Go:

println('Hello World");

21. F# Language

F#, pronounced as F sharp, is a strongly typed programming language. The language allows for more than one programming styles which makes it a multi-paradigm language. F# encompasses functional, imperative, and object-oriented programming techniques. The F# language belongs to the Microsoft .NET language family.

Features:

  • It provides type inference.
  • It allows writing higher order functions.

Hello World in F#:



printfn "Hello World"

22. Lisp Language

LISP, in full list processing, a computer programming language developed about 1960 by John McCarthy at the Massachusetts Institute of Technology (MIT). LISP was founded on the mathematical theory of recursive functions (in which a function appears in its own definition).

Features:

  • It provides advanced object-oriented programming.
  • It provides a convenient macro system.

Hello World in Lisp:

(print "Hello World")

23. JavaScript Language

JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complimentary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform.

Features:

  • Handling Dates and Time.
  • Detecting the User’s browser and OS.

Hello World in JavaScript:

Javascript




console.log("Hello World");

24. Algol Language

ALGOL, a computer programming language designed by an international committee of the Association of Computing Machinery (ACM), led by Alan J. Perlis of Carnegie Mellon University, during 1958–60 for publishing algorithms, as well as for doing computations.

Features:

  • Short For Algorithmic.
  • Family of Many Programming Languages For Scientific Computations. 

Hello World in Algol:



BEGIN DISPLAY("Hello World") END.

25. Perl Language

Perl is a general purpose, high-level interpreted and dynamic programming language. Perl supports both procedural and Object-Oriented programming. Perl is a lot similar to C syntactically and is easy for the users who have knowledge of C, C++. Since Perl is a lot similar to other widely used languages syntactically, it is easier to code and learn in Perl. Programs can be written in Perl in any of the widely used text editors like Notepad++, gedit, etc.

Features:

  • Perl Provides supports for cross-platform, and it is compatible with mark-up languages like HTML, XML etc.
  • It is free and an Open Source software that is licensed under Artistic and GNU General Public License (GPL).

Hello World in Perl:

Perl




#!/usr/bin/perl
print "Hello World";

26. TCL Language

The Tcl programming language was created in the spring of 1988 by John Ousterhout while working at the University of California, Berkeley. Tcl is the acronym for “Tool Command Language” (it is pronounced “tickle”). Tcl is actually divided into two things: a language and a library. Tcl is a simple textual programming language, intended for issuing commands to interactive programs such as text editors, debuggers and shells.

Features:

  • Reduced development time.
  • Quite easy to get started for experienced programmers; since, the language is so simple that they can learn Tcl in a few hours or days.

Hello World in TCL:

puts "Hello World"

27. TypeScript Language

TypeScript is a programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. TypeScript is designed for the development of large applications and transcompiles to JavaScript.

Features:

  • TypeScript is portable across browsers, devices, and operating systems. It can run on any environment that JavaScript runs on. Unlike its counterparts, TypeScript doesn’t need a dedicated VM or a specific runtime environment to execute.
  • Compiled TypeScript can be consumed from any JavaScript code. TypeScript-generated JavaScript can reuse all of the existing JavaScript frameworks, tools, and libraries.

Hello World in TypeScript:

console.log 'Hello World'

28. Fortran Language

FORTRAN was the world’s first high-level programming language. It was developed at IBM by a small team led by John Backus. The earliest version of FORTRAN was released in 1957 as a programming tool for the IBM 704.



Features:

  • FORTRAN allows the subroutines to be written to execute the functions and provide the return values.
  • FORTRAN supported the procedural programming language that allows the code to be written in an algorithmic way.

Hello World in Fortran:

program helloworld
    print *, "Hello World"
end program helloworld

29. Bash (Unix Shell)

Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. The name is an acronym for the ‘ Bourne-Again Shell ‘, a pun on Stephen Bourne, the author of the direct ancestor of the current Unix shell sh , which appeared in the Seventh Edition Bell Labs Research version of Unix.

Features :

  • Supports Brace Expansion.
  • Good Debugging.

Hello World in Bash:

echo "Hello World"

30. HTML Language

HTML stands for Hyper Text Markup Language, which is the most widely used language on Web to develop web pages. HTML was created by Berners-Lee in late 1991 but “HTML 2.0” was the first standard HTML specification which was published in 1995. HTML 4.01 was a major version of HTML, and it was published in late 1999.

Features:

  • It is platform-independent.
  • Images, videos, and audio can be added to a web page.

Hello World in HTML:

HTML




<!DOCTYPE html>
<html>
 <head>
 </head>
 <body>
   <h1>Hello World<h1>
 </body>
</html>
Hello World

So this is how we can print “Hello World” in 30 different languages. 




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!