01. Pythonprint('Hello, world!')02. C#include <stdio.h>int main() { printf("Hello, World!"); return 0;}03. C++#include <iostream>int main() { std::cout << "Hello World!"; return 0;}04. Javaclass HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); }} 05. C# namespace HelloWorld{ class Hello { static void Main(string[] args) { System.Console.WriteLine("Hello World!"); } }}06. Visual BasicImports System Module Module1 Sub Main() Console.WriteLine("Hello World!") Console.WriteLine("Press Enter Key to Exit.") Console.ReadLine() End SubEnd Module07. JavaScript
console.log('Hello World');08. SQLCREATE TABLE helloworld (phrase TEXT);INSERT INTO helloworld VALUES ("Hello, World!");SELECT * FROM helloworld;09. Assembly Languageglobal _start section .text_start: mov rax, 1 ; system call for write mov rdi, 1 ; file handle 1 is stdout mov rsi, message ; address of string to output mov rdx, 13 ; number of bytes syscall ; invoke operating system to do the write mov rax, 60 ; system call for exit xor rdi, rdi ; exit code 0 syscall ; invoke operating system to exit section .datamessage: db "Hello, World", 10 ; note the newline at the end
10. PHP<!DOCTYPE html><html><body> <h1>My first PHP page</h1> <?phpecho "Hello World!";?> </body></html>11. Swiftprint("Hello, world!")12. Gopackage main import "fmt" func main() { fmt.Println("hello world")}13. Rprint("Hello World!")14. Classic Visual BasicImports System Module Module1 Sub Main() Console.WriteLine("Hello World!") Console.WriteLine("Press Enter Key to Exit.") Console.ReadLine() End SubEnd Module15. MATLABfunction y = hello_world %#codegeny = 'Hello World!';16. Ruby puts "Hello World"17. Rustfn main() { println!("Hello World!");}18. Scala@main def hello() = println("Hello, World!")19. Perl#!/usr/bin/perluse warnings;print("Hello, World!\n");20. Scratch say Hello World!21. (Visual) FoxProMessagebox("Hello World!",64)? "Hello World"22. SASproc ds2 libs=work;data _null_; /* init() - system method */ method init(); declare varchar(16) message; /* method (local) scope */ message = 'Hello World!'; put message; end;enddata;run;quit;23. Objective-C- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Hello, World!"); [pool drain]; return YES; }
|