Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Apart from the case of branch predication, this is always achieved by selectively altering the control flow based on some condition.

  • In imperative programming languages, the term "conditional statement" is usually used.
  • In functional programming languages, the terms "conditional expression" or "conditional construct" are preferred, because these terms all have distinct meanings.
history | excerpt history