Ask Question
4 December, 15:35

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.

+2
Answers (1)
  1. 4 December, 16:27
    0
    Number of + operation done by this algorithm is 60

    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “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 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers