Ask coding questions

← Back to all posts
Division
Abs2606 (0)

Hi, im doing a simple project on c. and when i try to divide 120/100 or divide anything by 100, I dont get an accurate answer. It basically rounds itself to an integer despite the fact I defined the variable as a float. Would someone be able to explain why? Thank you

here is my replt link.
https://replit.com/join/cnolbdth-abs2606

Comments
hotnewtop
InvisibleOne (2840)

Try initiating pay as a double.