How should I accurate output?
CodePudding user response:
No problem, turn the decimal integer was like this,CodePudding user response:
Because your S is defined as an integer, when calculating the area of assignment statements on the right side of the expression type is the result of the double type, but there is an implicit conversion into integer assigned to the S, in the variable S memory is stored in the integer data, when the output is strong to float, is conducted on the basis of integer S coercion,CodePudding user response:
Int s with a double sCodePudding user response:
The integer s converted to floating point is you the resultCodePudding user response:
S=r * r * p; This statement execution time already remove the decimal point. Because s definition is of type int, there is no the decimal part of type int.CodePudding user response:
The