0
Why my code does not show the value "d" when the decimal point is an exact number?
https://code.sololearn.com/cao0k6bxZcr4/?ref=app https://code.sololearn.com/cao0k6bxZcr4/?ref=app
4 Respostas
+ 2
Arash Your code is perfectly fine and the value of d is also working fine .
Just split the inputs into multiple lines for eg : 10
%
2
And then submit , you'll get output : 10%2=0 where 0 is the value of variable d .
+ 1
Thanhs a lot
0
You need to convert <a> to a floating point type before you divide it by 100, otherwise, integer division occurs which gives unexpected results.
double d = c * (static_cast<double>(a) / 100);
0
turn the ints into double