> For the complete documentation index, see [llms.txt](https://labspc.gitbook.io/cnippets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://labspc.gitbook.io/cnippets/chap2.-lei-xing-yun-suan-fu-yu-biao-da-shi/2.5-suan-shu-yun-suan-fu.md).

# 2.5 算术运算符

C语言的灵活性与其操作符的多样性和强大性密切相关。C语言提供了许多操作符，这些操作符允许你执行各种操作，从简单的数学运算到位操作和逻辑运算。

C语言提供了一系列标准的数学操作符，如加法、减法、乘法和除法。这使得你可以执行各种数学计算，从简单的加法到复杂的数值计算

**Arithmetic Operators（算术操作符）**:

* * `+` : Addition（加法）
  * `-` : Subtraction（减法）
  * `*` : Multiplication（乘法）
  * `/` : Division（除法）
  * `%` : Modulus（取模） 取模不用于 double 和 float

**数学运算**：C语言提供了标准的数学操作符，如加法 (`+`)、减法 (`-`)、乘法 (`*`) 和除法 (`/`)，以进行基本的数学计算。

```c
int result = 5 + 3; // 加法
int difference = 10 - 4; // 减法
int product = 6 * 7; // 乘法
int quotient = 20 / 4; // 除法
```

还有一些更多的细节，需要在更多的例子中去实践。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://labspc.gitbook.io/cnippets/chap2.-lei-xing-yun-suan-fu-yu-biao-da-shi/2.5-suan-shu-yun-suan-fu.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
