For the algorithm below, compute the number of multiplications performed, as well as the final value of s. p ← 1 s ← 0 for i is
in {1, 2, 3, 4} do p ← p · 3 s ← s + p number of multiplications final value of s s =
1 answer:
<span>p ← 1
s ← 0
for i is in {1, 2, 3, 4}
do p ← p · 3
s ← s + p
n = 1 => first iteration
p = 1 * 3 = 3
s = 0 + 3 = 3
number of multiplications ---> 1
n = 2
p = 3 * 3 = 9
s = 3 + 9 = 12
number of multiplications ----> 1 + 1 = 2
n = 3
p = 9 * 3 = 27
s = 12 + 27 = 39
number o multiplications --> 2 + 1 = 3
n = 4
p = 27 * 7 = 81
s = 39 + 81 = 120
final number of multiplications -----> 3 + 1 = 4
final value of s
s = 120
Answer: number of mujltiplications: 4
final value of s: s = 120.
</span>
You might be interested in
Crosses x axis at (5,0) and slope -⅔. plug in to point slope formula to get
y=-⅔x-10/3
Answer:
Angle 2 = 75 degrees
Angle 1 = 105 degrees
14(9•x) X would be the variable, aka the number.
Answer:
b
Step-by-step explanation:
i just took it on edge
Answer:
there are 421.728182 calories
Step-by-step explanation:
177.4/110 = 1.61272727
1.61272727 x 261.5 = 421.728182
x= 421.728182