"Hello, World!" in Different Programming Languages: From Easy to Hard
Prakriti Anand
Posted on September 25, 2023
Programming is a fascinating journey and it all starts with printing "Hello, World!" on the screen. This simple program is the first step for many into the world of coding. Let's explore how to write this program in various programming languages, starting from the easiest to the more complex ones.
The Easy Ones
Ruby
Ruby is known for its simplicity and readability. Here's how you can print "Hello, World!" in Ruby:
puts "Hello World!"
Python
Python is another language famous for its simplicity. Here's the Python version:
print("Hello World!")
JavaScript
JavaScript, the language of the web, also makes it easy:
console.log("Hello World!");
Intermediate Languages
Swift
Swift, Apple's language for iOS development, has a straightforward syntax:
import Swift
print("Hello, World!")
PHP
PHP, a popular language for web development, requires a bit more code:
<?php
echo "Hello World!";
?>
Kotlin
Kotlin, a statically typed language from JetBrains, is gaining popularity for Android development:
fun main(args : Array<String>) {
println("Hello, World!")
}
The Hard Ones
C
C is a powerful language that provides low-level access to memory and is widely used in system programming:
#include<stdio.h>
int main()
{
printf("Hello World!");
}
C++
C++, an extension of C with additional features like classes and objects, is used in game development and system software:
#include <iostream>
int main()
{
std::cout << "Hello World!";
return 0;
}
LISP
LISP (LISt Processing) is one of the oldest high-level programming languages and has a unique syntax:
(defun hello-world ()
(format t "Hello World"))
(hello-world)
Java
Java, a class-based object-oriented language, is widely used in enterprise environments:
class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
C
C#, a language developed by Microsoft, is primarily used in Windows desktop applications and game development with Unity:
using System;
namespace HelloWorldApp {
class Program {
static void Main(string[] args) {
Console.WriteLine("Hello World!");
}
}
}
No matter which language you choose, writing your first "Hello, World!" program is an exciting milestone. Happy coding!
Posted on September 25, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.