Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Let the variable A be a long integer, then the following statement that cannot be executed normally is
Let the variable A be a long integer, then the following statement that cannot be executed normally is
The answer is C.

This problem involves two issues. One is the process of continuous calculation, and the other is what the result is.

Let's start with the first question. When calculating A= 16384*2, first calculate 16384*2, save the calculation result in a temporary variable, and then assign the value of this temporary variable to A. ..

Let me talk about the second question. What is the result of 16384*2? It is an integer because 16384 and 2 are both integers, so the calculation result is still an integer. And = 16384 * 2 = 32768, which is out of the integer range (-32768 to 32767) and overflows, and it will be reported as "overflow" at runtime.

To be clear, it is not the variable A that overflows, but the temporary variable.

How to use option a? Because 32768 is out of the integer range, it is treated as a long integer, and the result is still in the long range, so it is normal.

Because of 1.5, item B is treated as a haplotype and normal.

As for d, 190 and 2 are integers, and 190 2 = 36 100 seems to be overflowing. In fact, when calculating the power, the numbers before and after it are processed with double precision, so it will not overflow.