> For the complete documentation index, see [llms.txt](https://glados-2.gitbook.io/clight/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glados-2.gitbook.io/clight/reference/expressions-and-assignments/expressions.md).

# Expressions

Expressions are the combination of variables, operands, and operators. Expressions are processed based on the operator's precedence.

## Syntax

[*`expression-statement`*](/clight/reference/statements/expression-statements.md)*:*\
&#x20;   *`expression`* **`;`**

*`expression`*:\
&#x20;   *`assignement-expression`*

## Assignement Expressions

In assignment, the type of the right-hand value is converted to the type of the left-hand value, and the value is stored in the left operand after the assignment has taken place.

### Syntax

*`assignement-expression`*:\
&#x20;   *`binary-expression`*\
&#x20;   [*`identifier`*](/clight/reference/declarations-and-types.md#identifiers) [*`assignment-operator`*](/clight/reference/expressions-and-assignments/assignement-operators.md) *`assignement-expression`*\
&#x20;   *`unary-expression`*\
&#x20;   [*`function-call`*](/clight/reference/functions/function-calls.md)

### Example

```c
a = 0;
a += (2 + 4);
a /= add(1, 4);
```

## Binary Expressions

A *binary expression* contains two operands separated by one operator.

### Syntax

*`binary-expression`*:\
&#x20;    [*`number`*](/clight/reference/declarations-and-types.md#number) [*`binary-operator`*](/clight/reference/expressions-and-assignments/binary-operators.md) **(** [*`expression`*](/clight/reference/expressions-and-assignments/expressions.md) **|** [*`number`*](/clight/reference/declarations-and-types.md#number) **)**

### Example

```c
2 >= 4
8 == (4 + 3)
a != 9
```

## Unary Expressions

### Syntax

*`unary-expression`*:\
&#x20;    [*`identifier`*](/clight/reference/declarations-and-types.md#identifiers) [*`unary-operator`*](/clight/reference/expressions-and-assignments/unary-operators.md)

### Example

```c
a++
b--
```
