Thanks for responding. I have two questions.

1) sum+=value_squared //how does this += work

2) Why am I short 1 value when summing the exponents when I run the code?

Code:

#include<stdio.h>#include<math.h>
int power_table(int startingint, int endingint, int exponent, int sumvalue); //fucntion prototype
int main()
{
char line[10];
int startingint = 1;
int endingint = 1;
int exponent = 1;
int x = 1;
int sumvalue = 1;
printf("Enter the starting integer value:\n");
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &startingint);
printf("Enter the ending integer value:\n");
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &endingint);
printf("Enter the exponent:\n");
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &exponent);
power_table(startingint, endingint, exponent, sumvalue);
}
int power_table(int startingint, int endingint, int exponent, int sumvalue)
{
int x = 1;
int sumvalue = 1;
printf("x x^n sum\n");
printf("---------------\n");
for(x=startingint; x<=endingint; x++)
{
startingint = x;
exponent = pow(startingint, x);
printf("%d %d\n", startingint, exponent,);
sumvalue+=exponent;
}
printf("The sum of the exponent values = %d\n", sumvalue);
}