What is the value stored in the variable answer at the end of executing the following snippet?
answer=1
n=0
while(n<3):
answer=answer*3
n=n+1
What is the value stored in the variable answer at the end of executing the following snippet?
answer=1
n=0
while(n<3):
answer=answer*3
n=n+1
Answers
Answered by
0
while (0<3)
ans=0
n=1
while(1<3)
ans=3
n=4
while (2<3)
ans=6
n=3
while (3<3)
loop would not execute
Similar questions
Math,
6 months ago
English,
6 months ago
Math,
6 months ago
Social Sciences,
1 year ago
Physics,
1 year ago