Bob R.

asked • 09/29/20

Does anyone know how I can fix this error in my program? It is not printing the even numbers to the console.

Write a program that reads an integer and prints the sum of all even integers between 2 and the input value, inclusive.


I have uploaded a image of my program to google drive.

https://drive.google.com/file/d/1cUZn4f_9bPIyPD6f-Vl80Y-GJfnIy596/view?usp=sharing


Any help will be greatly appreciated.



1 Expert Answer

By:

Michael L. answered • 09/30/20

Tutor
5 (70)

Multiple Years Teaching Others & 4.0 Grades in Computer Science

Michael L.

Ahh, I see your "say" command now. It looks like it's only being called once when it should really be called for every even number between 2 and N. Hopefully this helps! if you need more information, feel free to reach out :)
Report

09/30/20

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.