Hello, I’m working on this task:
Write a program that outputs the sum of all even numbers between 150(including) and 250(not including).
Here is my code:
namespace ForLoops
{
class EvenSum
{
static void Main(string[] args)
{
int sum = 0;
for (int i= 149; i < 250; i=i+2)
{
sum = sum + i;
}
}
}
}
Can anyone please help me to solve it?