Home>Article>Backend Development> How to operate division in c language

How to operate division in c language

angryTom
angryTom Original
2020-02-20 13:58:52 21749browse

How to operate division in c language

How to operate division in c language

The division operation in c language uses the "/" symbol when calculating the result of arithmetic expression in C language , need to pay attention to the data type conversion of the operand during the calculation process.

Operations are performed on data and variables of the same data type, and the results maintain the original data type.

When operations are performed on data and variables of different data types, the result is a data type with high precision.

For example: the result of 1/2 is 0

The result of 1.0/2 is 0.5

Recommended learning:c language video tutorial

The above is the detailed content of How to operate division in c language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn