Here’s How You Can Say ‘Hello World’ in 26 Different Programming Languages

We all know that when people learn a new programming language, one of their first tasks is to learn how to code, “Hello World!” Being a very simple program to be understood easily in most computer languages, it is often used to illustrate the basic syntax of a programming language for a working program. In addition, “Hello world” program is also used to make sure that a language’s compiler, development environment, and run-time environment are correctly installed.

Here's How You Can Say ‘Hello World’ in 26 Different Programming Languages (3)

Today, we thought that we should share the ‘hello world’ program in 26 different programming languages.  Let’s take a look at these programs.


  1. 1. C

  2. 2. C++

  3. 3. C#

  4. 4. Java

  5. 5. JavaScript

  6. 6. HTML

  7. 7. Python

  8. 8. Pascal

  9. 9. Ruby

  10. 10. Visual Basic .NET

  11. 11. MatLab

  12. 12. jQuery

  13. 13. Bash

  14. 14. Perl 5

  15. 15. Basic

  16. 16. Objective-C

  17. 17. XSLT

  18. 18. CoffeeScript

  19. 19. Logo

  20. 20. VBScript

  21. 21. Clipper

  22. 22. Delphi

  23. 23. Julia

  24. 24. Processing

  25. 25. R

  26. 26. Swift

1. C

#include int main(void) { puts(“Hello, world!”); }

2. C++

#include int main() { std::cout << “Hello, world!”; return 0; }

3. C#

using System; class Program { public static void Main(string[] args) { Console.WriteLine(“Hello, world!”); } }

4. Java

import javax.swing.JFrame; //Importing class JFrame import javax.swing.JLabel; //Importing class JLabel public class HelloWorld { public static void main(String[] args) { JFrame frame = new JFrame(); //Creating frame frame.setTitle(“Hi!”); //Setting title frame frame.add(new JLabel(“Hello, world!”));//Adding text to frame frame.pack(); //Setting size to smallest frame.setLocationRelativeTo(null); //Centering frame frame.setVisible(true); //Showing frame } }

5. JavaScript

document.write(‘Hello, world!’);

6. HTML

Hello World!

7. Python

print “Hello, world!”

8. Pascal

program HelloWorld; begin WriteLn(‘Hello, world!’); end.

9. Ruby

puts “Hello, world!”

10. Visual Basic .NET

Module Module1 Sub Main() Console.WriteLine(“Hello, world!”) End Sub End Module

11. MatLab

disp (‘Hello, world!’)

12. jQuery

$(“body”).append(“Hello world!”);

13. Bash

echo “Hello World”

14. Perl 5

print “Hello, world!”;

15. Basic

PRINT “Hello, world!”

16. Objective-C

#import #import int main(void) { NSLog(@”Hello, world!”); return 0; }

17. XSLT

Hello World

18. CoffeeScript

console.log ‘Hello, world!’

19. Logo

print [Hello, world!]

20. VBScript

MsgBox “Hello, World!”

21. Clipper

? “Hello World”

22. Delphi

program HelloWorld; begin Writeln(‘Hello, world!’); end.

23. Julia

println(“Hello world!”)

24. Processing

void setup() { println(“Hello, world!”); }

25. R

cat(‘Hello, world!’)

26. Swift

println(“Hello, world!”)

While small test programs existed since the development of programmable computers, the tradition of using the phrase “Hello world!” as a test message was influenced by an example program in the seminal book, The C Programming Language, by Kernighan and Ritchie.

  1. Also Check: A Programmer Automates His Job For 6 Years

0 views0 comments