I am new on C#, i just learned loops.
I want to write loops that run this. (75 times)
I tried this way.
for (int i = 1; i <= 75; i++)
{
int sum = 0;
for (int p = 1; p <= i+1; p++)
{
Math.Pow(p, (i + 1));
sum = sum + p;
}
Console.WriteLine(sum);
}
Where am I doing wrong and how should I do about it?
Pow will not modify the value of p. You need to get the returned value into another variable. pp for example.
pp = Math.Pow(p, ...