C-18-Q101mediumsingle_mcq
To compute the sum from 1 to 50 via a while loop, the loop header is:
To compute the sum from 1 to 50 via a while loop, the loop header is:
- a
while count<50 - b
while count<=50 - c
while count==50 - d
while count>=50
ব্যাখ্যা
To include 50 in the summation, the loop must continue while the counter is less than or equal to 50, i.e. while count<=50. Using <50 would stop at 49 and omit the final term.