I'm kinda new to c# and I'm doing some projects on my own. In this project I need to find the values of the arithmetic a + (a + b) + (a + 2b) and so on. Then I need to add all the answers together. I have the first part done but I'm unsure how to add all the values I get from the loop.
class Program
{
static void Main(string[] args)
{
int a = 22;
int b = 8;
int answer;
Console.WriteLine(a);
for (int i = 1; i <= 43; i++)
{
answer = a + b * i;
Console.WriteLine(answer);
}
}
}