(Practice) Determine the values of the following integer expressions:
a) Specified expression is:
$$ 3+4 \times 6 $$
According to the operator precedence rule, the multiplication operation is first performed then the addition operation. The value of the expression evaluated as below:
$$ \begin{aligned} 3+4 \times 6 &=3+(4 \times 6) \\ &=3+24 \\ &=27 \end{aligned} $$
b) Specified expression is:
$$ 3 * 4 / 6+6 $$
According to the operator precedence rule, the multiplication operation is first performed. Then the division operator is performed before the addition operation. The value of the expression evaluated as below:
$$ \begin{aligned} \frac{3 \times 4}{6}+6 &=\left(\frac{(3 \times 4)}{6}\right)+6 \\ &=\left(\frac{(12)}{6}\right)+6 \\ &=2+6 \\ &=8 \end{aligned} $$
c) Specified expression is:
$$ 2 * 3 / 12 * 8 / 4 $$
According to the operator precedence rule, the multiplication operation is first performed, then the division operator. The value of the expression evaluated as below:
$$ \begin{aligned} \frac{2 \times 3}{12} \times 8 &=\frac{\left(\left(\frac{(2 \times 3)}{12}\right) \times 8\right)}{4} \\ &=\frac{\left(\left(\frac{(6)}{12}\right) \times 8\right)}{4} \\ &=\frac{((0.5) \times 8)}{4} \\ &=\frac{4}{4} \\ &=1 \end{aligned} $$
d) Specified expression is:
$$ 10 *(1+7 * 3) $$
According to the operator precedence rule, the multiplication operation is first performed then the addition operation. The value of the expression evaluated as below:
$$ \begin{aligned} 10 \times(1+7 \times 3) &=10 \times(1+(7 \times 3)) \\ &=10 \times(1+21) \\ &=10 \times 22 \\ &=220 \end{aligned} $$
e) Specified expression is:
\(50 \% 20\)
The value of the expression evaluated as below: \(50 \% 20=10\)
f) Specified expression is:
$$ 20-2 / 6+3 $$
According to the operator precedence rule, the division operation is first performed then the addition operation and subtraction operation. The value of the expression evaluated as below:
$$ \begin{aligned} 20-\frac{2}{6}+3 &=20-\left(\frac{2}{6}\right)+3 \\ &=20-0.33+3 \\ &=19.67+3 \\ &=22.67 \end{aligned} $$
g) Specified expression is:
$$ 20-2 /(6+3) $$
According to the operator precedence rule, the division operation is first performed then the addition operation and subtraction operation. The value of the expression evaluated as below:
$$ \begin{aligned} 20-\frac{2}{(6+3)} &=20-\left(\frac{2}{(6+3)}\right) \\ &=20-\left(\frac{2}{9}\right) \\ &=20-0.22 \\ &=19.78 \end{aligned} $$
The value of the expression is \(19.78\).
h)
Specified expression is:
$$ (20-2) / 6+3 $$
According to the operator precedence rule, the division operation is first performed then the addition operation. The value of the expression evaluated as below:
$$ \begin{aligned} \frac{(20-2)}{6}+3 &=\left(\frac{20-2}{6}\right)+3 \\ &=\left(\frac{18}{6}\right)+3 \\ &=3+3 \\ &=6 \end{aligned} $$
i)
Specified expression is:
$$ (20-2) /(6+3) $$
According to the operator precedence rule, the values of brackets are first solved before the division operation is performed. The value of the expression evaluated as below:
$$ \begin{aligned} \frac{(20-2)}{(6+3)} &=\frac{(20-2)}{(6+3)} \\ &=\frac{18}{9} \\ &=2 \end{aligned} $$
j) Specified expression is:
$$ (10+3) \% 4 $$
The value of the expression evaluated as below:
$$ \begin{aligned} (10+3) \% 4 &=13 \% 4 \\ &=1 \end{aligned} $$