赛派号

电价多少一度合理 Programming Fundamentals/Hello World

Overview[edit | edit source]

A “Hello, world!” program is a computer program that outputs or displays “Hello, world!” to a user. Being a very simple program in most programming languages, it is often used to illustrate the basic syntax of a programming language for a working program, and as such is often the very first program people write.[1]

Discussion[edit | edit source]

A “Hello, world!” program is traditionally used to introduce novice programmers to a programming language. “Hello, world!” is also traditionally used in a sanity test to make sure that a computer language is correctly installed, and that the operator understands how it works.[2]

The tradition of using the phrase “Hello, world!” as a test message was influenced by an example program in the seminal book The C Programming Language. The example program from that book prints “hello, world” (without capital letters or exclamation mark), and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan.[3]

In addition to displaying “Hello, world!”, a “Hello, world!” program might include comments. A comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. The syntax of comments in various programming languages varies considerably.[4]

Pseudocode[edit | edit source] Function Main ... This program displays "Hello world!" Output "Hello world!" End

Function Main ... This program displays "Hello World" Output "Hello World" End

Output[edit | edit source] 25%, 30% Hello world!

Each code element represents:[5]

Function Main begins the main function ... begins a comment Output indicates the following value(s) will be displayed or printed "Hello world!" is the literal string to be displayed End ends a block of code Flowchart[edit | edit source] Examples[edit | edit source]

The following pages provide examples of “Hello, world!” programs in different programming languages. Each page includes an explanation of the code elements that comprise the program and links to IDEs you can use to test the program.

Key Terms[edit | edit source] comment A programmer-readable explanation or annotation in the source code of a computer program. References[edit | edit source] Flowgorithm – Flowchart Programming Language Wikiversity: Computer Programming ↑ Wikipedia: "Hello, World!" program ↑ Wikipedia: "Hello, World!" program ↑ Wikipedia: "Hello, World!" program ↑ Wikipedia: Comment (computer programming) ↑ Programming Fundamentals/Hello World ← Input and OutputProgramming FundamentalsIntroduction Examples C++ →

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了