if statement

Conditional code block

An if statement is a programming construct that executes code only when a specified condition is true: The if statement checks whether the user is logged in before showing the dashboard.

Most programming languages extend this with else clauses for alternative paths and else-if chains for multiple conditions.

The if statement is fundamental to controlling program flow—nearly every program of any complexity uses them.

Related

then · true · false · logic · code · code block · switch · conditional · test · check · early return · flow · control · programming · decision · decision tree · execute · block

Categories
Opposites
conditionality

if statementgoto

Direct execution transfer

control flow type

if statementloop

Curve closing on itself

while loop · for loop · iteration · recursion · pattern matching

conditionality of execution

if statementno-op

Instruction without effect

Family

statement, state, stating, stated, states, stately, statesman, statehood, understate

Familiarity
Top 500,000
Profile
Used worldwide · Timeless · Rated G