Problem creating C++ program

Hi,
I am trying to create a c++ program that will intake an original value of x_0 to begin a function that uses the previous value of x to calculate the one in question.
I.e.- f(x_0) = x_1, f(x_1) = x_2 and so on.
I understand that I will need to set up a loop using x = f(x) but am unsure where how this is done exactly. The function itself being used is as follows: f(x) = a*sin(pi*x) where a and x_0 are the inputs. Any help would be great, thanks.
 
Back