Trying to store in a float table the values of a^i while (a) is an integer variable taken as input and i = 0,N (N also an integer variable taken as input)
Using this function I created:
void remplissage(double *t,int a,int N)
t[i] = pow(a,0.i);
void affichage(double *t,int N)
printf("tab[%d]= %.3f\n", i, t[i]);
Saisir a: 990
Saisir N= 5
0. in front of
i (or use
i / 10.0 as second argument to
pow instead -- see comments).
The way you have it, the exponent is always 0.
Actually, it is not standard compliant code because
i is an integer suffix and
0. a float constant. But it seems your compiler accepts it as 0 anyway.