0
When would one want to make use of the / operator?
This one noted that he / operator in certain languages, including C# serves the purpose of getting the quotient of two values while truncating the remainder giving one an integer. When would one want to do this? What sort of arithmetic would one be working out in a use case that calls for /?
3 Answers
+ 2
You get the quotient in integer division and when your result is of type integer.
Eg. You need 3 apples to make a pie. You have 20 apples. How many pies you can make?
+ 1
Nice example. Thanks Mihai.
+ 1
You're welcome.