I am currently attempting to write a program in which a user enters a number (Z) to be used to calculate the summation. I've been attempting to use nested for loops, to no avail.
This is a homework assignment, so rather an idea in the right direction than a full answer if possible.
Edit: In the example a Z of 10 is used to equate to 20790, which has been my method of checking if my code works
for(int x = 0; x<=z; x++)
{
for(int y =0; y<=x+1; y++)
{
sum = (z/2)*((x^2)+y+1);
total += sum;
}
}
This was my last attempt, albeit a poor one.