Learn how to write hello world in different languages. Here, we have a compilation of 10+ programming languages which helps you identify which one is easier to start your programming career with! 😉
The Hello World program is one of the very first programs that every programming student begins his journey in programming. The alternative to Hello World is Game Over program which is also one of the very famous programs.
The Hello World is one of the simplest programs that help the novice programmer to understand the basic syntax of the programming language and basically to get a feel of the programming environment.
Hello World in Different Languages
C
1 2 3 4 5 6 7 | #include<stdio.h> int main() { printf("Hello World in C\n"); return 0; } |
Must Read: C Program To Print Hello World in Linux
Swift
1 | println("Hello World in Swift") |
C++
1 2 3 4 5 6 7 8 9 | #include<iostream> using namespace std; int main() { cout << "Hello World in C++"; return 0; } |
Basic
1 | PRINT "Hello World in Basic" |
D
1 2 3 4 5 6 | import std.stdio; void main() { writeln("Hello World in D"); } |
Java
1 2 3 4 5 6 7 8 9 | import java.io.*; class helloWorld { public static void main(String args[]) { System.out.println("Hello World in Java\n"); } } |
Visual Basic
1 2 3 | Sub Main() MessageBox("Hello World in Visual Basic") End Sub |
jQuery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!DOCTYPE HTML> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function() { $("#placeholder").text("Hello World in jQuery"); }); </script> </head> <body> <div id="placeholder"> </div> </body> </html> |
HTML
1 2 3 4 5 6 7 | <!DOCTYPE HTML> <html> <head>Hello World Program in HTML</head> <body> <p>Hello World in HTML5</p> </body> </html> |
PHP
1 2 3 4 5 6 7 8 9 | <!DOCTYPE html> <html> <head>Hello World Program in PHP</head> <body> <?php echo "Hello World in PHP"; ?> </body> </html> |
Visual Fox Pro
1 | ? "Hello World in Visual Fox Pro" |
Python
1 | print("Hello World in Python\n"); |
Javascript
1 2 3 4 5 6 7 8 9 | <!DOCTYPE HTML> <html> <head>Hello World Program in Javascript</head> <body> <script type="text/javascript"> document.writeln("Hello World in Javascript"); </script> </body> </html> |
Bash / DOS
1 | echo "Hello World in Bash" |
Perl
1 | print "Hello World in Perl\n"; |
R
1 | print("Hello World in R") |
Go
1 2 3 4 5 6 7 8 | package main import "fmt" func main() { fmt.Printf("Hello World in Go") } |
Pascal
1 2 3 4 5 | program HelloWorldinPascal; begin writeln('Hello World in Pascal'); end |
Ruby
1 | puts "Hello World in Ruby" |
If you have any other code for hello world in different languages, please feel free to mention them in the comment section below. You must check Wikipedia article to know the history of hello world.
Wow. Excellent Compilation of so many hello world programs. Nice work.
Thanks for so many hello world programs in different languages.
This is just Amazing. It helps to compare different programming languages within a minute. Thanks a lot.