Help with horners

I have to write a program to calculate a row of numbers using horners method. I'm a three day coder, learning while doing. What I have so far is down below. I'm stuck at this piece |int C=(A*i); C+=(A--); C*=i; | I don't know how to make A lower again and restart the loop until e=0.

#include <iostream>
#include <iomanip>
#include <math.h>
#include <fstream>
using namespace std;

int main()
{
ofstream uitvoer("Horner.txt");
cout<< "enter a domain for x \n"<<endl; //domain x=[a.b]
int a, b;
cin >> a >> b;

cout<<"enter values for A and n\n"<<endl; // A=r, e=n
int r, e;
cin >> r >> e;

for (int i=b; i>=a; i--)
{
int A=r;
int C=(A*i); C+=(A--); C*=i;

cout <<setw(3)<<setprecision(1)
<< i<<""
<<setw(15)<<setprecision(1)
<<C<<endl;
uitvoer <<setw(3)<<setprecision(1)
<<i<<""
<<setw(15)<<setprecision(1)
<<C<<endl;
}
system ("pause");
return 0;
}
Topic archived. No new replies allowed.