Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Condition: Difference between revisions

From Coderwiki
new: info, operators, statements
 
replace incorrect link to Conditional operator with Comparison operator
 
Line 6: Line 6:
Conditional [[Operator|operators]] are the [[syntax]] used to evaluate a statement to a [[boolean]] [[value]].
Conditional [[Operator|operators]] are the [[syntax]] used to evaluate a statement to a [[boolean]] [[value]].


See: [[Conditional operator]].
See: [[Comparison operator]].


== Conditional statements ==
== Conditional statements ==

Latest revision as of 10:35, 15 August 2025

A condition is a statement that evaluates to a boolean value.

They are often used in selection statements (such as if statements) to branch code (do different things based on input).

Conditional operators

edit edit source

Conditional operators are the syntax used to evaluate a statement to a boolean value.

See: Comparison operator.

Conditional statements

edit edit source

Conditional statements are selection: they allow us to branch code based on the result of a condition.

The main conditional statement is the if statement, but there are other types of selection, such as the switch statement and match statement.