+ 1

Why I get this weired result for x?!!

https://code.sololearn.com/ch8OiG7vZVUI/?ref=app

14th Aug 2019, 10:51 AM
Ramin firouzabadi
Ramin firouzabadi - avatar
2 Answers
+ 2
Change variables' type from int to double and you'll get correct result.
14th Aug 2019, 10:54 AM
Qasem
+ 2
Its because of the maximum size of int that y*100 is bigger then it turns it to the minimum of int size
14th Aug 2019, 10:56 AM
AmirHosseinHabibi
AmirHosseinHabibi - avatar