0
Basic Concepts Arithmetic Operators C#
What is the output of this code? int x = 16; int y = 5; Console.WriteLine(x/y); is 3.2 but if you have int z=x/y Console.WriteLine(z); then is 3
2 Respostas
+ 1
this is because the "/ "can not give us the answer in decimals.
for the remainder you will have to use "%" seperately
Console.WriteLine(x%y);
0
use variable float for this, after value put 'f' example: 3.2f