/**
 * Given two integers 'start' and 'end', calculate the sum of all even numbers between them (both inclusive).
 * Use a while loop to iterate through the numbers.
 * Return the sum of even numbers.
 *
 * For example:
 * - sumOfEvenNumbers(5, 10) should return 24
 * - sumOfEvenNumbers(10, 15) should return 36
 * - sumOfEvenNumbers(2, 20) should return 110
 *
 * Difficulty Level: Difficult
 */
fun sumOfEvenNumbers(start: Int, end: Int): Int {

    var total = 0
    var current = start

    // Iterate while current is less than or equal to the end
    while (current <= end) {
        // Check if current number is even
        if (current % 2 == 0) {
            total += current
        }
        // Increment current by 1
        current++
    }

    return total
}
/**
 * Given two integers 'start' and 'end', calculate the sum of all even numbers between them (both inclusive).
 * Use a while loop to iterate through the numbers.
 * Return the sum of even numbers.
 *
 * For example:
 * - sumOfEvenNumbers(5, 10) should return 24
 * - sumOfEvenNumbers(10, 15) should return 36
 * - sumOfEvenNumbers(2, 20) should return 110
 *
 * Difficulty Level: Difficult
 */
fun sumOfEvenNumbers(start: Int, end: Int): Int {
/**
 * Given two integers 'start' and 'end', calculate the sum of all even numbers between them (both inclusive).
 * Use a while loop to iterate through the numbers.
 * Return the sum of even numbers.
 *
 * For example:
 * - sumOfEvenNumbers(5, 10) should return 24
 * - sumOfEvenNumbers(10, 15) should return 36
 * - sumOfEvenNumbers(2, 20) should return 110
 *
 * Difficulty Level: Difficult
 */
fun sumOfEvenNumbers(start: Int, end: Int): Int {

    var total = 0
    var current = start

    // Iterate while current is less than or equal to the end
    while (current <= end) {
        // Check if current number is even
        if (current % 2 == 0) {
            total += current
        }
        // Increment current by 1
        current++
    }

    return total
}