Hello ,
For the given snippet , why the result comes out to be 2..while it should be 3 , if the expression is interpreted from Left-Right or .75 for vice-versa.

>>>3/2*2
2
>>>

Recommended Answers

All 2 Replies

Because it is an integer division. 3/2 yields 1, not 1.5

Because it is an integer division. 3/2 yields 1, not 1.5

Thanks a lot...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.