In C language, the way to express tens of thousands is: (1) Divide the number by 10000 to get the integer part; (2) Use the % remainder operator to take the remainder of the division result to 10000 to get tens of thousands. bit value.
How to express tens of thousands in C language
In C language, the way to express tens of thousands is to use %
Remainder operator and division by 10000 operation.
Specific steps:
%
remainder operator to take the remainder of the division result to 10000 to obtain a value in the tens of thousands. Code Example:
<code class="c">int number = 123456; int thousand_digit = number / 10000; int thousand_digit_remainder = number % 10000;</code>
In the above example, the thousand_digit
variable will store the integer part 12, while the thousand_digit_remainder
The variable will store the tens of thousands value 3456.
The above is the detailed content of How to express tens of thousands in C language. For more information, please follow other related articles on the PHP Chinese website!