the parameters of a linear equation

Hi guys,
i have to solve the parameters of a linear equation as y=a*x+b
my problem is: i have to define x between [0;1000] and i must take for every x different values for b and a.
i'm new in c++ and i dont know how can i define the parameters

Thanks
Like this:
1
2
3
4
5
6
7
int a = 100;
int b = 200;
for(int x = 0; x < 1000; ++x)
{
  int y = a * x + b;
  // do something with y
}
Thanks for your help.but it will be a little big difficult, if i have an polynomial-equation e.g one calculate for every value the other parameters as a, b,c if i have an equation third order or whatever else, actually i wanna calculate the parameters of an polynomial-equation with the help of c++ based on excel, that one give for every value a parameter to calculate y, i wanna instead of each parameter individually to indicate, I would like to leave everything running through a time..

i hope i described my problem

thanks in advance
@coder777 - I think the OP wants the C++ code to make coffee with two teaspoons of sugar and cream... ...talk about changing specs!
Topic archived. No new replies allowed.