Examine the following lines of code:
Current = 1
Sum = 0
N = 5
While current <= n:
Sum = sum + current
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
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
Q118: 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
Q124: Give a while loop that adds up
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