I need to calculate the value of sin(sin...(sin(x))) for n times (n and the value of sin are input from the keyboard).
That's is what I've came up with.
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
double multipleSin(int n, double x);
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{double x,k; int n;
cout<<"x= ";
cin>>x; cout<<"n= "; cin>>n;
cout<<multipleSin<<' ';
//k=sin(x);
//cout<<"check "<<k<<endl;
system("pause");
return 0;
}
double multipleSin(int n, double x)
{
if(n>1)
x=multipleSin(n-1,x);
else
return sin(x);
}
The probles seems to be fairly simple but I can't figure it out though.
Any advise how to make this work properly?