CodePudding user response:
First is a integer to integer with % 0 f output is possible,In addition, a=1.0/3 * 3; Because a is integer, 1.0/3 * 3 results may be 0.999 XXXX; So again into integer number is 0,
Modified method:
Float a;//define a type to float
Try ~
CodePudding user response:
double a;CodePudding user response:
Line 4 code:int a;
Modified into
Float a;
This will be the original data type for the integer data, a modified to and support the significant figures for at least six single precision floating point data of decimal places a
To accommodate the 5 results
CodePudding user response: