0
About the Type Casting problem in C++
The code is right logic but when it run, the output is false. Ex, enter number 5.56 and save into var 'a' t =(int)a =5 a = a-t => a=0.56. a*=10 =5.6 t = 5 a = a-t => a=0.6 a *=10 = 6 t = (int)a = 5(dont know why???) a = a-t => 1 if enter number ex 6 then it output right result. https://code.sololearn.com/cGPHYxzj6caq/?ref=app
3 Respostas
+ 8
https://code.sololearn.com/c3UAxnirjRw5/?ref=app
cout is rounding. floating point math is fun
+ 1
Dude, I'm seeing this question since last five minutes and still I'm unable to understand it....
0
i run my code on app Mobile C on android.