A
A
AlexMark2016-06-19 14:06:33
Java
AlexMark, 2016-06-19 14:06:33

How does multiplication and division work for an int variable?

I ran into one problem in the task, and in the process of searching for a solution, I came across an interesting nuance, which is in this code ideone.com/JsF87w (nuance for me)
why is the answer equal to 100 ?, although it should be 90

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav, 2016-06-19
@Firik67

Not an expert in java, but I assume that 10/100 is rounded down, i.e. to 0. And as a result 100-0=100

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question