Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer program
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example computer program== The [["Hello, World!" program]] is used to illustrate a language's basic [[Syntax (programming languages)|syntax]]. The syntax of the language [[Dartmouth BASIC|BASIC]] (1964) was intentionally limited to make the language easy to learn.<ref name="cpl_3rd-ch2-30_quote1">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 30 | isbn = 0-201-71012-9 | quote = Their intention was to produce a language that was very simple for students to learn[.] }}</ref> For example, [[Variable (computer science)|variables]] are not [[Declaration (computer programming)|declared]] before being used.<ref name="cpl_3rd-ch2-31">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 31 | isbn = 0-201-71012-9 }}</ref> Also, variables are automatically initialized to zero.<ref name="cpl_3rd-ch2-31"/> Here is an example computer program, in Basic, to [[average]] a list of numbers:<ref name="cpl_3rd-ch2-30">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 30 | isbn = 0-201-71012-9 }}</ref> <syntaxhighlight lang="basic"> 10 INPUT "How many numbers to average?", A 20 FOR I = 1 TO A 30 INPUT "Enter number:", B 40 LET C = C + B 50 NEXT I 60 LET D = C/A 70 PRINT "The average is", D 80 END </syntaxhighlight> Once the mechanics of basic computer programming are learned, more sophisticated and powerful languages are available to build large computer systems.<ref name="cpl_3rd-ch2-30_quote2">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 30 | isbn = 0-201-71012-9 | quote = The idea was that students could be merely casual users or go on from Basic to more sophisticated and powerful languages[.] }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)