+ 1

16/5=3?? Operators C#

Check that question

2nd Apr 2018, 9:44 PM
Jose Daniel
Jose Daniel - avatar
3 ответов
+ 2
If you're using integers, then 16 / 5 will equal 3, because the remainder is ignored. You need to use variables of type double (which are real numbers). Integers can't have decimal points, the can only be whole numbers. Real numbers (known as floating point numbers in computer science, or floats or doubles), CAN have decimal points.
2nd Apr 2018, 9:52 PM
Emma
+ 4
Yep to add onto what Xan has said it is called Integer division, in which only the whole integer number (3) would be returned and the remainder being (1) ignored.
2nd Apr 2018, 10:35 PM
Tarantino
Tarantino - avatar
+ 1
Thanks bros
2nd Apr 2018, 11:27 PM
Jose Daniel
Jose Daniel - avatar