Skip to content

Instantly share code, notes, and snippets.

@alphaKAI
Last active June 29, 2016 20:38
Show Gist options
  • Save alphaKAI/ac79ccecaab5656e592253501371efbc to your computer and use it in GitHub Desktop.
Save alphaKAI/ac79ccecaab5656e592253501371efbc to your computer and use it in GitHub Desktop.
Hello World in various language(which I can use or have touched)

#Hello World in various programming languages

##Listed

  • C
  • C++
  • D
  • Ruby
  • TypeScript
  • F#
  • Haskell
  • Scheme
  • Java
  • Scala

##C

#include <stdio.h>

int main() {
  printf("Hello, World!\n");

  return 0;
}

##C++

#include <iostream>

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

  return 0;
}

##D

import std.stdio;

void main() {
  writeln("Hello, World!");
}

##Ruby

puts "Hello, World!"

##TypeScript

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

F#

printfn "Hello, World!"

##Haskell

main = putStrLn "Hello, World!"

##Scheme

(display "Hello, World!")

##Java

import java.io.*;

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

##Scala

object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, World!")
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment