happyd8699 1. JavaScript
console.log("Hello World!");
2. Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
3. Python
# Python 2
print "Hello World!"
# Python 3
print("Hello World!")
4. Ruby
puts 'Hello World!'
5. PHP
echo 'Hello World';
6. C++
#include <iostream>
int main()
{
std::cout << "Hello World!";
}
7. CSS
<style type="text/css">
h1 {
color: DeepSkyBlue;
}
</style>
<h1>Hello World!</h1>
8. C#
using System;
public class HelloWorld
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
9. C
#include<stdio.h>
main()
{
printf("Hello World!");
}
10. Go
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
11. Shell
#!/bin/bash
echo "Hello World!"
12. Objective C
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello World!");
[pool drain];
return 0;
}
13. Scala
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello World!")
}
}
14. Swift
print("Hello World!")
15. TypeScript
class HelloWorld {
constructor(public greeting: string) { }
sayHello() {
return "<h1>" + this.greeting + "</h1>";
}
};
var greeter = new HelloWorld("Hello World!");
console.log(greeter.greet());