Statement (computer science)

statementstatementscompound statementprogram statement
In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out.wikipedia
102 Related Articles

Imperative programming

imperativeimperative programming languageimperative language
In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out.
In computer science, imperative programming is a programming paradigm that uses statements that change a program's state.

C (programming language)

CC programming languageC language
Many imperative languages (e.g. C) make a distinction between statements and definitions, with a statement only containing executable code and a definition instantiating an identifier, while an expression evaluates to a value only.
C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.

Goto

GO TOGo To Statement Considered Harmfulcomputed goto
GoTo (goto, GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages.

Return statement

return valuereturn addressreturn
In C++, (where is an expression) is a statement that tells a function to return execution of the program to the calling function, and report the value of.

Assertion (software development)

assertionsassertionassert
Several modern programming languages include checked assertions – statements that are checked at runtime or sometimes statically.

For loop

FORfor-loop loop
In computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly.

Block (programming)

blockblocksblock structured
Blocks consist of one or more declarations and statements.

Programming language

programming languageslanguagedialect
In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out.
For example, the semantics may define the strategy by which expressions are evaluated to values, or the manner in which control structures conditionally execute statements.

Do while loop

do-while loop loop
In most computer programming languages, a do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given boolean condition at the end of the block.

Conditional (computer programming)

conditionalif-then-elseconditional statement
For languages without call-by-name parameters the semantic description of a loop or conditional is usually beyond the capabilities of the language.
In imperative programming languages, the term "conditional statement" is usually used, whereas in functional programming, the terms "conditional expression" or "conditional construct" are preferred, because these terms all have distinct meanings.

While loop

while loop
This contrasts to many statement parameters that can be evaluated several times (e.g. the condition of a while loop) or not at all (e.g. the loop body of a while loop).
In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition.

Control flow

looploopscontrol structure
For languages without call-by-name parameters the semantic description of a loop or conditional is usually beyond the capabilities of the language.
In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.

Subroutine

functionfunctionssubroutines
Often statement keywords are reserved such that they cannot be used as names of variables or functions.
Procedure calls either behave syntactically as statements (e.g., a procedure may be called as or are explicitly invoked by a statement such as or (e.g., ).

Functional programming

functionalfunctional programming languagefunctional language
In languages that mix imperative and functional styles, such as the Lisp family, the distinction between expressions and statements is not made: even expressions executed in sequential contexts solely for their side effects and whose return values are not used are considered 'expressions'.
It is a declarative programming paradigm in that programming is done with expressions or declarations instead of statements.

Comparison of programming languages (syntax)

comment syntaxStatement terminatorBasic syntax
Programming language statements typically have conventions for:

Lisp (programming language)

LispLisp programming languageLisp 1.5
In languages that mix imperative and functional styles, such as the Lisp family, the distinction between expressions and statements is not made: even expressions executed in sequential contexts solely for their side effects and whose return values are not used are considered 'expressions'. When call-by-name parameters are available a statement like behaviour can be implemented with subroutines (see Lisp).
Unlike most other languages, no distinction is made between "expressions" and "statements"; all code and data are written as expressions.

ALGOL 68

Algol68ALGOL-68GOST 27974-88
Among imperative programming languages, Algol 68 is one of the few in which a statement can return a result.
This scheme not only avoids the dangling else problem but also avoids having to use and in embedded statement sequences.

Expression (computer science)

expressionexpressionsevaluation environment
A statement may have internal components (e.g., expressions).
In many languages (e.g. C++), expressions may be ended with a semicolon to turn the expression into an expression statement.

Computer programming

programmingcodingprogrammable
In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out.

Identifier (computer languages)

identifieridentifiersname
Many imperative languages (e.g. C) make a distinction between statements and definitions, with a statement only containing executable code and a definition instantiating an identifier, while an expression evaluates to a value only.

List of programming languages by type

Curly bracket programming languagecurly bracketsbracket-delimited languages
Programming languages are characterized by the type of statements they use (e.g. the curly brace language family).

Reserved word

keywordkeywordsreserved keyword
Often statement keywords are reserved such that they cannot be used as names of variables or functions.

Variable (computer science)

variablevariablesscalar
Often statement keywords are reserved such that they cannot be used as names of variables or functions.