I have written a program to calculate y
values according to given x
values for the function y = (sqrt(3+x^2))/(20x^2+sqrt(x)). Using two counters, one for x values [i], and one for y values [n]. My x values show up fine, however, the y values return zeroes. What would be the mistake here? Very appreciated.
for (i = 0; i < 30; i++)
{
x[i] = 20 i * 2 + 3;
}
for (n = 0; i < 30 && n < 50; i++, n++)
{
y[n] = (sqrt(3 + (pow(x[i], 2))))) / (20 * pow(x[i], 2) + sqrt(x[i]));
}
for (i = 0, n = 0; i < 30 && n < 50; i++, n++)
printf("x %lf, y %lf", x[i], y[n]);
return 0;
}