Fixed formatting issues. (#35137)
parent
a70b243ea2
commit
aa302cd5e5
|
@ -22,7 +22,7 @@ if(boolean_expression)
|
|||
int a = 100;
|
||||
if(a < 200)
|
||||
{
|
||||
printf("a is less than 200\n" );
|
||||
printf("a is less than 200\n");
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -262,7 +262,7 @@ int main(void) {
|
|||
As seen above, both `if` blocks are executed. In the second, the value of `x` is has been overwritten to `4`, which may not be what you want.
|
||||
|
||||
## 7. Ternary operation
|
||||
The ternary operator (AKA conditional operator) is an operator that takes three arguments. The first argument is a comparison argument, the second is the result upon a true comparison , and the third is the result upon a flase comparison .It can be thought of as a shortened way of writing an if-else statement. It is often used to to assign variables based on the result of a comparison.
|
||||
The ternary operator (AKA conditional operator) is an operator that takes three arguments. The first argument is a comparison argument, the second is the result upon a true comparison , and the third is the result upon a flase comparison. It can be thought of as a shortened way of writing an if-else statement. It is often used to to assign variables based on the result of a comparison.
|
||||
|
||||
#### Syntax
|
||||
```C
|
||||
|
|
Loading…
Reference in New Issue