94.2k views
0 votes
Consider the following algorithm. x â 1 for i is in {1, 2, 3, 4} do for j is in {1, 2, 3} do x â x + x for k is in {1, 2, 3, 4, 5} do x â x + 1 x â x + 5 Count the number of + operations done by this algorithm.

User Wbamberg
by
5.6k points

2 Answers

7 votes

Answer:

i can't see some of the numbers

Step-by-step explanation:

User Morepenguins
by
5.8k points
5 votes

Answer:

Number of + operation done by this algorithm is 60

Step-by-step explanation:

i = 4

j = 3

k = 6

Now, let "n" be number of '+' operations

n = i × j + i × 2k

substituting the figures

n = 4 × 3 + 4 × (2 × 6)

n = 12 + 4 × 12

n = 12 + 48

n = 60

User Mervin
by
5.9k points