For Loops

Create a function named “SumEvenNos” that takes two integers as arguments and returns the sum of all even numbers between them (inclusive). Use a For loop in your solution.

Your function will accept two different numbers as input, and then you should use those numbers as part of your For loop.

Hint: You can go from the lower one to the upper one. Additionally, use the Mod function to determine if a number is even or not.

Use the following data with your function.

Figure 21.6: Sample data from SumEvenNos function.

Here is a potential solution:

Show Code