The given expression is evaluated as follows:
$\implies \underbrace{\underbrace{3+1}+5}*2/\underbrace{7+2}-4-7-6/2\; [ \text{As '+' has higher predence with left associative in the operators present in the expression.}]$
$\implies(3+1)+5*2/7+2-4-7-6/2$
$\implies(4+5)*2/7+2-4-7-6/2$
$\implies9*2/(7+2)-4-7-6/2$
$\implies9*2/\underbrace{9-\underbrace{4-\underbrace{7-6}}}/2\; [ \text{As '-' has higher predence with right associative in the operators present in the expression.}]$
$\implies9*2/9-4-(7-6)/2$
$\implies9*2/9-(4-1)/2$
$\implies9*2/(9-3)/2$
$\implies \underbrace{9*2}/6/2 \; [ \text{As '*' has higher predence with right associative in the operators present in the expression.}]$
$\implies(9*2)/6/2$
$\implies \underbrace{18/\underbrace{6/2}} \; [ \text{As '/' has higher predence with right associative in the operators present in the expression.}]$
$\implies18/(6/2)$
$\implies18/3=6$
Similar kind of questions asked in GATE CSE 2016 Set 1 | Question: 45