Question 50 of 65Pseudocodepseudocode nested loops

What will be the output of the following pseudocode?

Integer i, j, p, total
Set p = 1, total = 0
for (each i from 1 to 3)
    for (each j from 1 to i)
        p = p * 2
    End for
    total = total + p
End for
Print total

The verified answer and full solution are one login away

Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.

Log in to see the answer
← Q49Q51 →Attempt the full timed mock