Solved

Examine the Following Lines of Code

Question 41

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions