Write a program that calculates the product of even natural numbers in a given range [n1, n2] - n1 and n2 to enter.
Hint: if an even value is entered for n1, the cycle starts from n = n1, if an odd value is entered - from n = n1 + 1
#include <iostream>
int main()
{
std::cout << "Enter the starting number: ";
int start_num { };
std::cin >> start_num;
std::cout << "Enter the ending number: ";
int end_num { };
std::cin >> end_num;
std::cout << '\n';
std::cout << "List of even numbers between " << start_num << " and " << end_num << '\n';
// if the starting number is not even bias it towards even
if (start_num % 2) { start_num++; }
for (int i { start_num }; i <= end_num; i += 2)
{
std::cout << i << ' ';
// use the same loop to calculate the product summation
}
std::cout << '\n';
}