Question 34 What will be the output of the algorithm given below?
Deloitte technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Question 34
What will be the output of the algorithm given below?
Algorithm:
1 : Start
2 : Initialize a = 3, m = 1, p = 0;
3 : Check if a < 20 then
4 : a = a + m
5 : m = a * m
6 : else p = m + a
7 : a = m * 3
End if
8 : Check if a = m then
9 : p = a + m
10: a = p + m
End if
11: a = m * 2
12: Print a
13: Check if p < 10 then go to step 3
End while
14: Else stop
**Output
Show answer & explanation
Answer: A. A) 12 96 244
Rigorous quantitative and aptitude evaluation.
Step-by-step Derivation:
Step 1: Formulate algebraic equations.
Step 2: Solve step-by-step.
Step 3: Match with correct option.