i would like to know how c++ is calculating this equations manually...??
if i put this codes in c++ compiler i got those answers.. but how..?? i cant use compiler for theory exam.. so please help me..
i also would like to know how does this "%" sign works... how is it calculating in "question1 and question 2"..??
* has the highest precedence so it is 2 and 5 that will be multiplied: (2 * 5) + 1 - 2
+ and - both has the same precedence so instead we look at the associativity column on the right. It says "Right-to-left""Left-to-Right" which gives: ((2 * 5) + (1 - 2))(((2 * 5) + 1) - 2)
EDIT: Fixed mistake pointed out by keskiverto below.