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)
{
for(int x = 150; x < 250; x = x + 2) {
Console.WriteLine(x);
}
}
}
}
Can anyone please help me to solve it?