Q8. What will be the value of t if a = 56 , b = 876?
Read ab
+
M
b
Function mul(a, b)
t=0
while (b != 0)
t = t + a
b=b-1
End While
return t;
End Function
A. 490563
B* 49056
C 490561
D. NOTA
Answers
Answered by
17
Answer:
What will be the value of t if a = 56 , b = 876?
Read ab
+
M
b
Fu b)
t=0
while (b != 0)
t = t + a
b=b-1
End While
return t;
End Function
A. 490563
B* 49056
C
Answered by
0
Correct answer is 49056 (option B)
The given function is
Function mul(a, b):
t=0
while (b != 0)
t = t + a
b = b-1
End while
return t;
- In the above function while loop runs b times.
- The given function continuously add 56 to 't' for 'b' times.
t = 56 + 56 + 56 + ............56 (b times added)
So, t = 56 x b = 56 x 876 = 49056
- This function is multiplication of a and b.
Hence the output is 49056.
#SPJ3
Similar questions