*smashes head*
Sorry for being so damn unspecific. -_-'
Its C++.
Cmath worked, thanks.
And now same program, new problems.
#include<iostream>
#include<cmath>
using namespace std;
void series(int, int);
int main()
{
int x, n;
cout<<"\nEnter the value of x & n…\n";
cin>>x>>n;
series(x, n);
return 0;
}
void series(int x, int n)
{
int sum=1,f=1,j;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=(2*n-1);j--)
f*=j;
sum+=f/pow(x,i); //Line 20
}
cout<<"\n"<<sum;
}
Line 20 - Error - Call of overloaded function 'pow(int&, int&)' is ambigous
Help please.
Hello,
I did
#include <cmath>
using name space std;
and upon compilation, code::blocks opens up the cmath file and gives the following error message for all the math functions, (e.g. like for arc cosine):
error '::acos' has not been declared
Also, I added under Project build options-> linker settings->link libraries : m for math.
Advice on what us wrong?
Thanks,
Frank