Sum of even numbers from A to B
Swift
Easy
math
Task «Sum of even numbers from A to B»
Given two integers A and B (A ≤ B). Find the sum of all even numbers in the range from A to B inclusive. Implement a solution using a loop.
Input Format
Two integers A and B, separated by a space.
Output Format
One integer — the sum of even numbers from A to B.
Examples
Example 1
INPUT
7
OUTPUT
YES
Example 2
INPUT
10
OUTPUT
NO
main.swift