0
When I write this n=(2*100)/3; its actual ans is 66.66667 but it shows 66.00000 why it is? And how I fix it to show exact value?
8 Respuestas
+ 2
(2*100)/3 is evaluates as integer division because its operands are both int.
you should use
(2*100)/3.0
or
(2.0*100)/3
+ 1
C language
0
Aditya Chandrikapure
Which language are you using?
please add tag to get correct person to help you
0
What I do for this?
If you know please help me
0
I don't know C, but would guess it is caused by the program interpreting your request as an integer intput, instead of a float input
0
Aditya Chandrikapure
Update your post with a tag showing the C language
0
I take n as float not an int
0
Aditya Chandrikapure i dont know whic language are u using but answer in python3 is absolutely correct.