
Arshadul Q.
asked 03/29/22Fill in the blank with a for loop to sum all the even numbers from 2 to 100: sum = 0 sum = sum + n end
More
1 Expert Answer

Donald W. answered 03/30/22
Tutor
5.0
(214)
Personalized tutoring in Math and Computer Science
Not sure what language this is supposed to be in since the template was left out of the question, but here is what the loop would look like in C/C++:
int sum = 0;
for (int i=2; i<=100; i+=2) {
sum += i;
}
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Donald W.
Did you forget to include the template with a blank to fill in? It's hard to tell what language this is supposed to be in, too.03/30/22