Computer Program Statement
Jump to navigation
Jump to search
A Computer Program Statement is a computer program statement in a computer program (expressed in some programming language).
- AKA: Program Statement.
- Context:
- It can range from being an Imperative Programming Statement to being a Declarative Programming Statement.
- It can be a Data Statement, such as: a Data Structure Definition Statement, a Data Manipulation Statement, a Data Access Statement.
- It can be Conditional Logic Statement.
- Example(s):
- Counter-Example(s):
- See: Computer Program, Statement, Programming Statement.
References
2012
- (Wikipedia, 2009) ⇒ http://en.wikipedia.org/wiki/Statement_%28programming%29
- In computer programming a statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).
Many languages (e.g. C) make a distinction between statements and definitions, with a statement only containing executable code and a definition declaring an identifier. A distinction can also be made between simple and compound statements; the latter may contain statements as components.
- In computer programming a statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).
2009
- (Wikipedia, 2009) ⇒ http://en.wikipedia.org/wiki/Statement_%28programming%29
- The following are the major generic kinds of statements with examples in typical imperative languages:
- assignment:
A:= A + 1
- call:
CLEARSCREEN()
- return:
return 5;
- goto:
goto 1
- assertion:
assert(ptr != NULL);
- block:
begin integer NUMBER; WRITE('Number? '); READLN(NUMBER); A:= A*NUMBER end
- if-statement:
if A > 3 then WRITELN(A) else WRITELN("NOT YET"); end
- switch-statement:
switch (c) { case 'a': alert(); break; case 'q': quit(); break; }
- while-loop:
while NOT EOF DO begin READLN end
- do-loop:
do { computation(&i); } while (i < 10);
- for-loop:
for A:=1 to 10 do WRITELN(A) end
- assignment:
- The following are the major generic kinds of statements with examples in typical imperative languages: