“Hello, World!” is the first program every programmer starts his programming journey with. It is the first step in every developer’s journey. Now, let’s start our journey by writing “Hello World” in 20 different programming languages.
1. C Programming Language
C is a general-purpose, procedural programming language developed by Dennis Ritchie at AT&T Bell Labs in 1972. C is closely related to UNIX, as it was developed to write the UNIX OS (operating system).
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
2. C++ Programming Language
C++ is a high-level, general-purpose programming language designed by Danish computer scientist Bjarne Stroustrup in 1979. It was developed as an extension of C, and the syntax of both languages is almost similar.
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello, World!";
return 0;
}
3. C# Programming Language
C# is a general-purpose high-level programming language that was developed by Microsoft in 2000. It is used to develop web applications, desktop apps, mobile apps, games, and more.
using System;
namespace Hello
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
4. Java Programming Language
Java is a high-level, class-based, object-oriented programming language developed by James Goslin at Sun Microsystems in May 1995. It is also used to develop mobile apps, web apps, desktop apps, games, and more.
public class Program
{
public static void main(String[] args)
{
System.out.print("Hello, World!");
}
}
5. Python Programming Language
Python is a high-level, general-purpose programming language developed by Guido Van Rossum in February 1991. The name Python is said to have come from the British comedy series Monty Python's Flying Circus.
print("Hello, World!")
6. JavaScript Programming Language
JavaScript is a high-level programming language developed by Brendan Eich in December 1995. It was originally designed as a scripting language for websites, but it has been widely adopted as a general-purpose programming language, and is currently the most popular programming language.
console.log("Hello, World!");
7. TypeScript Programming Language
According to Wikipedia, "TypeScript is a free and open-source high-level programming language developed by Microsoft in October 2012 that adds static typing with optional type annotations to JavaScript. It is designed for the development of large applications and transpiles to JavaScript."
console.log 'Hello World'
8. PHP Programming Language
According to Wikipedia, "PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in June 1995. PHP was originally an abbreviation of Personal Home Page, but it now stands for the recursive acronym PHP: Hypertext Preprocessor".
<?php
echo "Hello, World!";
?>
9. Swift Programming Language
Swift is a high-level, general-purpose, multi-paradigm, compiled programming language developed by Apple in June 2014.
import Swift
print("Hello, World!")
10. Ruby Programming Language
Ruby is an interpreted, high-level, object-oriented, general-purpose programming language. It was developed by Yukihiro "Matz" Matsumoto in Japan in the mid-1990s (1995).
puts "Hello, World!"
11. Kotlin Programming Language
Kotlin is a cross-platform, statically typed, general-purpose, high-level programming language developed by JetBrains in July 2011.
fun main(args: Array<String>)
{
print("Hello, World!");
}
12. Visual Basic Programming Language
Visual Basic is an object-oriented programming language developed by Microsoft in May 1991. Its last version 6 (VB6) was released in 1998. On April 8, 2008, Microsoft stopped supporting the VB6 IDE, leaving it in the legacy state.
Module HelloWorld
Sub Main()
Console.WriteLine("Hello, World!")
End Sub
End Module
13. Cobol Programming Language
As per Wikipedia, "COBOL is a compiled English-like computer programming language designed for business use. 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".
IDENTIFICATION DIVISION
PROGRAM-ID HELLO-WORLD
PROCEDURE DIVISION
DISPLAY "Hello, World!"
STOP RUN
14. GO Programming Language
Go is a fast, statically typed, compiled, high-level, general-purpose programming language developed by the Go authors in November 2009. It is known for its simplicity and efficiency.
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
15. Rust Programming Language
Rust is a general-purpose programming language designed by Graydon Hoare in May 2015. It emphasizes performance, type safety, and concurrency. It enforces memory safety, which means that all references point to valid memory.
fn main() {
println!("Hello, World!");
}
16. Perl Programming Language
Perl is a high-level, general-purpose, interpreted, dynamic programming language developed by Larry Wall in December 1987
print "Hello, World!\n";
17. R Programming Language
R is a programming language designed by Ross Ihaka and Robert Gentleman in August 1993 for statistical computing and data visualization. It has been adopted in the fields of data mining, bioinformatics, and data analysis.
cat("Hello, World!\n")
18. MATLAB Programming Language
As per Wikipedia, "MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB was invented by mathematician and computer programmer Cleve Moler in late 1970s. The idea for MATLAB was based on his 1960s PhD thesis".
disp('Hello, World!');
19. Dart Programming Language
Dart is an object-oriented, class-based programming language designed by Lars Beck and Kasper Lund and developed by Google in October 2011. It can be used to develop web and mobile applications as well as server and desktop applications.x
void main() {
print('Hello, World!');
}
20. SQL (MSSQL Server/ MySQL / PostgreSQL)
Structured Query Language (SQL) is a domain-specific language used for data management, particularly in relational database management systems (RDBMS).
SELECT 'Hello, World!';
See you in the next article, till then, take care and be happy learning.
You can connect with me @
Conclusion
In this article, we have discussed how to print “Hello World!” in 20 different programming languages.
I hope you enjoyed this article. Follow C# Corner to learn more new and amazing things about technologies.
Thanks for reading.