Computer Science, asked by bhumika5656, 11 months ago

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 parthomsarwade
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