/**
 * This function appends all even numbers within the specified range to a list.
 *
 * Task:
 * - Use the range function to generate a range of numbers from rangeStart to rangeEnd (inclusive).
 * - Iterate through the range and check if each number is even.
 * - If the number is even, append it to the list.
 * - Return the final list containing all the even numbers.
 * - Do not use any external libraries or modules.
 *
 * @param rangeStart The starting number of the range (inclusive).
 * @param rangeEnd The ending number of the range (inclusive).
 * @return A list containing all the even numbers within the specified range.
 */
fun appendEvenNumbers(rangeStart: Int, rangeEnd: Int): List<Int> {

    val evenNumbers = mutableListOf<Int>()  // Initialize an empty list to store the even numbers

    // Iterate through the range and check if each number is even
    for (num in rangeStart..rangeEnd) {
        if (num % 2 == 0) {
            evenNumbers.add(num)  // Append even numbers to the list
        }
    }

    return evenNumbers
}
/**
 * This function appends all even numbers within the specified range to a list.
 *
 * Task:
 * - Use the range function to generate a range of numbers from rangeStart to rangeEnd (inclusive).
 * - Iterate through the range and check if each number is even.
 * - If the number is even, append it to the list.
 * - Return the final list containing all the even numbers.
 * - Do not use any external libraries or modules.
 *
 * @param rangeStart The starting number of the range (inclusive).
 * @param rangeEnd The ending number of the range (inclusive).
 * @return A list containing all the even numbers within the specified range.
 */
fun appendEvenNumbers(rangeStart: Int, rangeEnd: Int): List<Int> {
/**
 * This function appends all even numbers within the specified range to a list.
 *
 * Task:
 * - Use the range function to generate a range of numbers from rangeStart to rangeEnd (inclusive).
 * - Iterate through the range and check if each number is even.
 * - If the number is even, append it to the list.
 * - Return the final list containing all the even numbers.
 * - Do not use any external libraries or modules.
 *
 * @param rangeStart The starting number of the range (inclusive).
 * @param rangeEnd The ending number of the range (inclusive).
 * @return A list containing all the even numbers within the specified range.
 */
fun appendEvenNumbers(rangeStart: Int, rangeEnd: Int): List<Int> {

    val evenNumbers = mutableListOf<Int>()  // Initialize an empty list to store the even numbers

    // Iterate through the range and check if each number is even
    for (num in rangeStart..rangeEnd) {
        if (num % 2 == 0) {
            evenNumbers.add(num)  // Append even numbers to the list
        }
    }

    return evenNumbers
}