You are getting the number 2 because of how division is taking place before multiplication, because of how division is coming before multiplication because it comes first, read it from left to right. Not only that but because you are dividing integers the results will truncate towards zero.
Hi rabster and boost lexical cast Thanks for your reply
I have one doubt. Compiler give first preference to multiplication after that division is working. But this example first division is working. How? Please explain..