Hello World Program Wikipedia, the free encyclopedia Hello, World! Program is a computer program that is only printed "Hello, World!" (English, intention, "Hello, World!") On the computer screen. The program is usually the first program that the initiator of the computer programming language should learn the first programs written. It can also be used to determine the language compiler, program development environment, and the operating environment has been properly installed.
The Hello World program is the first learning process, and now it has become a tradition. The program appeared earlier in a computer program design tutorial "C language program design" written by Brian Kernighan and Dennis Ritchie.
The following is several examples of the Hello World program written in different languages:
Directory [Show Hide] 1 Print to Terminal
1.1 ADA1.2 assembly language
1.2.1 x86 CPU, DOS, Tasm1.2.2 x86 CPU, GNU / Linux, NASM
1.3 awk1.4 Basic1.5 BCPL1.6 Befunge1.7 Brainfuck1.8 C1.9 C 1.10 C # (C Sharp) 1.11 COBOL1.12 Common Lisp1.13 Dos Batch1.14 Eiffel1.15 Erlang1.16 Forth17 Fortran1 .18 HQ9 1.19 Intercal1.20 Java1.21 Mixal1.22 OCAML1.23 PASCAL1.24 Perl1.25 php1.26 Pike1.27 PL / I1.28 prolog1.29 Python1.30 Rexx1.31 Ruby1.32 Scheme1.33 SED (Requires at Least One Line of Input) 1.34 Smalltalk1.35 Snobol1.36 SQL1.37 TCL1.38 TURING1.39 Unix-Style Shell
2 GUI
2.1 Delphi2.2 Visual Basic2.3 Visual FoxPro2.4 x112.5 Java2.6 Java Applet2.7 JavaScript2.8 PostScript
3 External link [edit] Print to the terminal [edit] adaWith ada.text_io; use ada.text_line; "Hello, World!"); End hello; [edit] assembly language [edit] x86 CPU, DOS , Tasmmodel SmallidealStack 100H
Dataseg HW DB 'Hello, World! $'
CODESEG MOV AX, @Data MoV DS, AX MOV DX, OFFSET HW MOV AH, 09H INT 21H MOV AX, 4C00H INT 21hend [edit] x86 CPU, GNU / Linux, NASM; "Hello World" for Linux on Intel 80x86 Using NASM (Intel Syntax) .; Enter this Into "Hello.asm" The TYPE: "NASM -F Elf Hello.asm"; "ld hello.o Hello"; "./ Hello"
section .data; data section declarationmsg db 'Hello World!', 0AHlen equ $ -msg; string lengthsection .text; code section declarationglobal _start; entry point (start of execution) _start: mov edx, len; string length mov ecx, msg String Start MoV EBX, 1; File Handle: Stdout Mov Eax, 4; Sys_WRITE INT 80H; Kernel System Call
MOV EBX, 0; RETURN VALUE MOV EAX, 1; SYS_EXIT INT 80H; Kernel System Call [Edit] awkbegin {print "Hello, World!"} [edit] Basic Traditional version BASIC:
10 Print "Hello, World!" 20 END Modern version of Basic:
Print "Hello, World!" [Edit] bcplget "libhdr"
Let Start () be $ (Writes ("Hello, World! * N") $) [edit] befunge "! DLROW OLLEH"> V, ^ _ @ [edit] BRAINFUCK [> > > <<<< -]> .> . .. .> . << .>. . ------. --------.> .>. [Edit] c # include
INT main (void) {Printf ("Hello, World! / N"); return 0;} [edit] C # include
Int main () {std :: cout << "Hello, World! << std :: end; Hello, World! ");}} [Edit] CobolidAndification Division.Program-id. Hello-World.environment Division.
Data Division.
Procedure Division.display "Hello, World!". Stop Run. [Edit] Common Lisp (Format T "Hello World! ~%") [Edit] dos batch @ echo offecho "Hello, World!" [Edit] Eiffelclass Hello_World
Creation Makefeature Make Is Local IO: Basic_io Do !! IOO.PUT_STRING ("% N Hello, World!") End - Makend - Class Hello_World [editing] Erlang -Module (Hello). -export ([Hello_World / 0 ]).
Hello_World () -> IO: FWRITE ("Hello, World! / N"). [Edit] Forth. "Hello, World!" CR [edit] fortran write (*, 10) 10 Format ('Hello, World!' ) Stop end [edit] HQ9 h [edit] intercalplease do, 1 <- # 13do, 1 sub # 1 <- # 238do, 1 sub # 2 <- # 112do, 1 sub # 3 <- # 112do, 1 SUB # 4 <- # 0do, 1 sub # 5 <- # 64do, 1 sub # 6 <- # 238do, 1 sub # 7 - # 26do, 1 sub # 8 <- # 248do, 1 sub # 9 - # 168Do, 1 sub # 10 <- # 24do, 1 sub # 12 <- # 158do, 1 sub # 13 <- # 52please read out, 1please give up [editing] javapublic class hello { Public static void main (string [] args) {system.out.println ("Hello, World!");}} [edit] Mixalterm EQU 19 the Mix Console Device Number Orig 1000 Start AddressStart Out MSG (Term) Output Data At Address MSG HLT HALT EXECUTIONMSG ALF "MIXAL" ALF "Hell" ALF "o Wor" ALF "ld" end start end of the program [edit] ocamllet main () = print_endline "Hello World!" ;; [edit] PascalProgra M Hello; 'Hello, World!'); end. [edit] Perl #! / usr / local / bin / perlprint "hello, world! / n"; [edit] PHP php print ("Hello , World! ");?> [edit] Pike #! / usr / local / bin / pikeint main () {WRITE (" Hello, World! / N "); return 0;} [edit] PL / ITEST: Procedure Options (main); declare my_string char (20) Varying Initialize; PUT SKIP LIST (my_string); end test; [edit] Prologgoal Write ("Hello, World!"). [edit] Python #! / usr / local / bin / pythonprint "Hello, World!" [edit] RexxSay "Hello, World!" [edit] Ruby #! / usr / bin / rubyprint "Hello, World! / N"
[Edit] Scheme (DISPLAY "[edited] Sed (Requires at Least One Line Of Input) Sed -ne '1S /.*/ Hello, World! / P' [Edit] SmallTalkTranscript Show : 'Hello, World!' [Edit] Snobol Output = "Hello, World!" End [edit] SQLCREATE TABLE Message (Text Char (15)); Insert Into Message (TEX) VALUES ('Hello, World!'); Select text from Message; Drop Table Message; [edit] TCL #! / usr / local / bin / tclputs "Hello, World!" [edit] Turingput "Hello, World!" [edit] unix-style shell #! / bin / Shecho 'Hello, World!' [edit] GUI [edit] Delphiprogram HelloWorld; Uses Dialogs; Begin ShowMessage ('Hello, World!'); end. [edit] Visual BasicmsgBox "Hello, World!" [edit] Visual FoxPro "Hello, World!" [Edit] x11 with a program Xmessage 'Hello, World!' Use C and GTKMM 2
#include
Class HelloWorld: PUBLIC GTK :: WINDOW {public: helloworld (); virtual ~ helloworld (); protected: gtk :: button m_button; virtual void on_button_clicked ();};
HelloWorld :: HelloWorld (): m_button ( "Hello, world!") {Set_border_width (10); m_button.signal_clicked () connect (SigC :: slot (* this, & HelloWorld :: on_button_clicked)); add (m_button);. m_button.show ();
HelloWorld :: ~ HelloWorld () {}
Void helloworld :: on_button_clicked () {cout << "Hello, World!" << endl;}
INT main (int Argc, char * argv []) {gtk :: main kit (argc, argv); helloworld helloworld; gtk :: main :: run (helloWorld);} [edit] javaimport java.awt. *; import Java.awt.event. *;
Public class helloframe extends frame {helloframe {super (title);} public void Paint (graphics g) {super.paint (g); java.awt.insets INS = this.dibstring (); g.drawstring "Hello, World!", INS.LEFT 25, INS.TOP 25);} public static void main (string args []) {helloframe fr = new helloframe ("hello"); fr.addwindowlistener (New Windowadapter) ) {Public void window {system.exit (0);}}); fr.setresizable (true); fr.setsize (500, 100); fr.setvisible (true);}} [edit] Java AppletJava applet is used for HTML files.
HelloWorld Program Says:
Body> html>
Import java.applet. *; import java.awt. *;
Public Class HelloWorld Extends Applet {Public Void Paint (Graphics G) {G.drawString ("Hello, World!", 100, 50);}} [edit] JavaScriptjavascript is a scripting language for HTML files. To view the run results of the following program, you can copy it to any HTML text.