Erlang - Decision Making
Decision making structures requires that the programmer should specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
Following is the general form of a typical decision making structure found in most of the programming languages −
Erlang programming language provides the following types of decision making statements.
|Sr.No.||Statement & Description|
An if statement consists of a Boolean expression followed by one or more statements.
The if expression also allows for multiple expressions to be evaluated at once.
You can use one if or else if statement inside another if or else if statement(s).
It can be used to execute expressions based on the output of the case statement.