# 조건문

Soulver에서 조건문은 한 줄에 표현됩니다:

```
earnings = $45k                                 | $45,000.00

if earnings > $30k then tax = 20% else tax = 5% | 20%

My tax paid: earnings × tax                     | $9,000.00
```

**조건문을 사용하여 변수 선언하기**

```
income = $35k
expenses = $21.5k

profitable = true if income > expenses     | true
insolvent = false unless expenses > income | false
```

**조건문에서 "and"와 "or" 사용하기**

```
BMI = 24
Underweight = BMI < 18.5                  | false
Healthy Weight = BMI >= 18.5 and BMI < 25 | true
Overweight = BMI >= 25 and BMI < 30       | false
Obese = BMI >= 30                         | false
```

{% hint style="info" %}
&&와 ||도 지원됩니다
{% endhint %}

#### 비교 연산자 및 불리언

Soulver는 표준 ["C" 스타일](https://en.wikipedia.org/wiki/C_\(programming_language\)) 비교 연산자를 지원합니다.

불리언 값(`true` 또는 `false`)이 반환됩니다.

| Name                     | Operator |
| ------------------------ | -------- |
| Equal to                 | ==       |
| Not equal to             | !=       |
| Greater than             | >        |
| Less than                | <        |
| Greater than or equal to | >=       |
| Less than or equal to    | <=       |

변수에 불리언 값을 직접 할당할 수 있습니다.

```
cost = $500                                 
discount = true                        
if discount then cost = cost - 10%
cost | $450.00
```

또한 if문 외부에서도 비교 연산자를 사용할 수 있습니다.

```
20km == 20,000 m   | true
11:30 am < 9:30 am | false
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.soulver.app/ko/undefined/general/conditionals-and-comparisons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
