39 language written Hello World Programs

xiaoxiao2021-03-06  14

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 [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 #include #include #include using namespace std;

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.

Hello World </ title> </ head> <body></p> <p>HelloWorld Program Says:</p> <p><Applet code = "helloworld.class" width = 600 height = 100> </ applet></p> <p></ Body> </ html></p> <p>Import java.applet. *; import java.awt. *;</p> <p>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.</p> <p><script language = "javascript"> Function HelloWorld () {JavaScript: Alert ("Hello World");} </ script></p> <p><a href="javascript :this.location()"οnclick="javascript:HelloWorld();"> Hello World Example </A> [Edit] PostScriptPostScript is a language that is specifically used to create images and is often used for printers.</p> <p>/ Font / Courier Findfont 24 ScalefontFont SetFont100 100 Moveto (Hello World!) ShowshowPage</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-48227.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="48227" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.032</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '3OJNrzwNKcjDWr2Dmhzc8_2FofgGt98xYeKNz_2BQ9JgiKvwLg596ed2hcccCP84QUDoa3Qy49YoIWVAOQT7wWY5_2Fg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>