I'm sorry. I really need help on this. I even made a shorter and simpler program that I think is enough to show my problem.

This is the example program:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int i, j, deg, points;
printf("Enter degree of polynomial equation: "); scanf("%i", °);
printf("Enter number of points: "); scanf("%i", &points);
float xs[points-1], Fmat[points][deg];
for(i=0; i<points; i++)
{printf("x%i = ", i); scanf("%f", &xs[i]);}
printf("\n");
for(i=0; i<points; i++)
for(j=0; j<deg+1; j++)
Fmat[i][j]=pow(xs[i],1);
for(i=0; i<points; i++)
{for(j=0; j<=deg; j++)
printf("%ii%ij:%7.3f\t", i,j,Fmat[i][j]);
printf("\n");}
system("PAUSE");
return 0;
}

Now, my problem is that it is printing (and probably storing) the right values EXCEPT on the last column.

This is greatly confusing me and I've spent my whole night trying to figure it out (to no avail, obviously). I'm sorry for the dumbness of my problem but will somebody please help me figure it out??

Thanks in advance.

Sample output: Imageshack - output

Screenshot of program: Imageshack - programl