English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang Conditional Statements

Decision structures require the programmer to specify one or more conditions to be evaluated or tested by the program, and if the condition is determined to be true (true), one or more statements to be executed, and if the condition is determined to be false (false), other statements to be executed.

The general form of the typical decision structure commonly found in most programming languages is as follows-

The Erlang programming language provides the following types of decision statements.

Serial NumberStatements and Descriptions
1

If Statement

An if statement consists of a boolean expression and one or more statements.

2

Multiple Expressions

The if expression also allows the simultaneous calculation of multiple expressions

3

Nested if Statements

An if or else if statement can be used within another if or else if statement

4

Case Statement

It can be used to execute expressions based on the output of a case statement