parent
62bf5ad17d
commit
90a417b331
|
@ -68,7 +68,7 @@ There are a few important things that are different here. First, `stdbool.h` has
|
|||
Within the parenthesis of the if statement is something new, too: `n == 3`. This is a comparison between `n` and the number 3. `==` is the comparison operator, and is one of several comparison opertations in C.
|
||||
|
||||
## Nested if-else
|
||||
The if-else statement allows a choice to be made between two possible alternatives. Sometimes a choice must be made between more than two possibilities. For example the sign function in mathematics returns -1 if the argument is less than zero, returns +1 if the argument is greater than zero and returns zero if the argument is zero. The following C++ statement implements this function:
|
||||
The if-else statement allows a choice to be made between two possible alternatives. Sometimes a choice must be made between more than two possibilities. For example the sign function in mathematics returns -1 if the argument is less than zero, returns +1 if the argument is greater than zero and returns zero if the argument is zero. The following C statement implements this function:
|
||||
|
||||
```C
|
||||
if (x < 0)
|
||||
|
|
Loading…
Reference in New Issue