What is the final value of after the execution of the code segment below? 5 6 20
ID: 3834629 • Letter: W
Question
What is the final value of after the execution of the code segment below? 5 6 20 24 The following code segment is intended to find the smallest of two values entered by the user. Which of the following statements is true about this code segment. The code segment always works as intended. The code segment never works as intended. The code segment only works for positive values entered. The code segment only works for negative values entered. What does the sprite say when the following code segment is executed? 30 20 15 -30Explanation / Answer
9) The answer is b) 6
Explanation:
1st loop count=1 num=4
2nd loop count=2 num=8
3rd loop count=3 num=12
4th loop count=4 num=16
5th loop count=5 num=20
6th loop count=6 num=24
loop exits;
10) The answer will be b) never work as intended.
Because, the given code is not handling the negative numbers, so we cant say it only takes positive number.
11) answer is a) 30
decrement count by 1 for five time,so it will be count=20-5=15
and count+count=30.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.