# Thread: I need help with a little calculation on C

1. ## I need help with a little calculation on C

Hello smart ones,
Please I want to perform this calculation and save it in a variable 'x'. like
X1. A
X2. A+H
X3. A+H+CH
X4. A+H+CH+C^2H
X5. A+H+CH+C^3H .....etc
to 15 times
and save it in variable x. I will use x to calculate this function y = (6 * pow(x,2) + 29*x + 14) / (32 - pow(x,5)). so that when I print 'y', I will get the values from X1 to X15

double i, x = a;
for (i = 0; i < b ; i++)
x = x + pow(c,i)* h

I Used this but I'm getting the value from X2 instead of from X1

Thank you. It's urgent, I am new to programming.. 2. So this?
Code:
```for (i = 0; i < b ; i++) {
x = x + pow(c,i)* h;
y = (6 * pow(x,2) + 29*x + 14) / (32 - pow(x,5));
}``` 3. This is what I get. Note the value of A is 0.1.
x1 should be 0.1 not 0.3  4. Do you have code for that, or is it just a screen-shot from your assignment.

> x1 should be 0.1 not 0.3
Code:
```for (i = 0; i < b ; i++, x = xnew ) {
xnew = x + pow(c,i)* h;
// figure out whether you need x or xnew in this calc.
y = (6 * pow(x,2) + 29*x + 14) / (32 - pow(x,5));
// figure out whether you print x or xnew along with y
}``` 5. Thank you. You are The best. I have a code already but It is ok now. Can I have a means of communicating with you like from facebook or WhatsApp. Popular pages Recent additions calculation, powx, save, urgent, variable 