Examine the following lines of code:
Current = 1
Sum = 0
N = 5
While current <= n:
Sum = sum + current
Current = current + 1
What is the value of sum after the loop completes all of its iterations?
A) 5
B) 1
C) 15
D) The value of sum will never be available, as this is an infinite loop
Correct Answer:
Verified
Q113: Infinite loops are the result of user
Q114: A definite loop is a loop that
Q115: A boolean flag is a variable with
Q116: Which form of control does the while
Q117: Which of the following can the condition
Q119: Examine the following lines of code:
Current =
Q120: Examine the following lines of code:
While True:
Print('Hello
Q121: Examine the following lines of code:
Current =
Q122: Examine the following lines of code:
Which =
Q123: Python built-in functions _ and _ can
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents