Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 2
How to do a floor division in C++?
2 Answers
+ 16
Use type casting as follows :
https://code.sololearn.com/cUfb02FD8JXo/?ref=app
+ 4
Dividing 2 int variables is floor division only.
7 / 2 = 3, 6 / 2 = 3, 5 / 2 = 2 and so on.