C-18-Q053mediumsingle_mcq
To compute the sum from 1 to 50 (short-answer task), which condition is correct?
To compute the sum from 1 to 50 (short-answer task), which condition is correct?
- a
while count<=50 - b
while count<50 - c
while count==50 - d
while count>=50
ব্যাখ্যা
To include 50 in the sum, the condition must be count<=50, allowing the counter value 50 to enter the loop body. Using <50 would stop at 49 and exclude the final value.