An algorithm supposed to calculate the sum of numbers from 1 to n returns a higher value than expected.What is the most likely mistake? - Study24x7
Social learning Network
2 followers study24x7 25 Jun 2024 12:37 PM study24x7 study24x7

An algorithm supposed to calculate the sum of numbers from 1 to n returns a higher value than expected.
See more

A

Starting the loop from 0

B

Not initializing the sum variable

C

Adding n twice

D

All of the above

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles