Question
whats the output?
1 = 4 b = 10.0 C = 19.0 while i < 10: if b < c: print(b, <, c) elif í > 8: print(b + c) 1 + 1 else: print(1) C = 1 C -= 2 b
0 0
Add a comment Improve this question Transcribed image text
Answer #1

OUTPUT:

10.0 < 19.0 11.0 < 17.0 12 .0< 15.0 7 8 26.0 . .Program finished with exit code 0 Press ENTER to exit console.

Explanation:

1. When i=4, b=10.0 and c=19.0, clearly b<c then "10.0 < 19.0" will be printed

2. Now, i=5 , b=11.0 and c = 17.0 clearly b<c then "11.0 < 17.0" will be printed

3. Now, i=6 , b=12.0 and c = 15.0 clearly b<c then "12.0 < 15.0" will be printed

4. Now, i=7 , b=13.0 and c = 13.0 b<c is False, and i>8 is also False

else condition will run, "7' will be printed. and c = 14.0

5. Now, i=8 , b=14.0 and c = 14.0 - 2=12.0 b<c is False, and i>8 is also False

else condition will run, "8' will be printed. c = 13.0

6. Now, i=9, b=15.0, c = 13.0 - 2 = 11.0 b<c is False, but i>8 is True So, print(b+c) will execute

"26.0" will be printed.

7. Now i=10 while loop will be terminated.

Add a comment
Know the answer?
Add Answer to:
whats the output? 1 = 4 b = 10.0 C = 19.0 while i < 10:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT