2 min read
Hello World

A “Hello, World!” program is generally a computer program that ignores any input and outputs or displays a message similar to “Hello, World!“. A small piece of code in most general-purpose programming languages, this program is used to illustrate a language’s basic syntax.

Hello Worlds in Multiple Languages

C

#include <stdio.h>

int main(void) {
  printf("Hello, World!\n");
  return 0;
}

C++

#include <iostream>

int main() {
  std::cout << "Hello, World!" << std::endl;
  return 0;
}

C#

using System;

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

Java

include java.io.*;

public class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, World!");
  }
}

Rust

fn main() {
  println!("Hello, World!");
}

JavaScript

console.log("Hello, World!");

Python

print('Hello, World!')

Ruby

puts 'Hello, World!'