Computer Programming/Statements

From Wikibooks, open books for an open world
Jump to navigation Jump to search
This computer programming article is available in pseudocode, Ada, C, C++, and Delphi.

Note: there are some simplifications in the explanations below. Don't take anything too literally.

Most programming languages have the concept of a statement. A statement is a command that the programmer gives to the computer. For example:

println "Hi there!"

This command has a verb ("println") and other details (what to print). In this case, the command "println" means "show on the screen," not "print on the printer." The programmer either gives the statement directly to the computer (by typing it while running a special program), or creates a text file with the command in it. You could create a file called "hi.txt", put the above command in it, and give the file to the computer.

If you have more than one command in the file, each will be performed in order, top to bottom. So the file could contain:

println "Hi there!"
println "Strange things are afoot..."