This series of posts will explore the idea of comparative programming – doing the same tasks in different languages. The usefulness or difficulty of the task is of no importance, just want to compare the languages by doing. The first program has to be the “Hello World” of course. Let’s see.
C:

#include <stdio.h>

int main() {
printf("Hello World!\n");
return 0;
} 
C++:

#include <iostream>
int main() {
  std::cout<<"Hello World ! \n";
  return 0;
} 

Lua:

#!/usr/bin/lua
print("Hello World!\n")

Python:

print “Hello World\n”

Go (golang):

package main

import "fmt"

func main() {
 fmt.Println("Hello World\n")
}
# go run hello.go

Tcl:

puts stdout "Hello, World!\n"

Awk:

awk 'BEGIN {print "Hello World\n"}'

PowerShell:

PS> echo "Hello World\n"

Java:

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

keywords: languages, programming, c-language, c++-language, java-language, python-language, tcl-language, awk-language, lua-language, go-golang-language, powershell-language