Treat main as a function:
- You have no parameters in the () after main.
- You have to return an integer at the end of the function, though most compilers will automatically return a value for main so you dont need to.
Essentially, just write the function like this:
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int setprecision(int pi);
int main()
{
double pi;
pi = ( asin(1)*2 );
cout << " The value of pi is: " << pi << setprecision(pi) << endl;
}
int setprecision()
{
return pi;
}
--
Of course, you'll need to change the code according to want you want. For more information, check out:
http://learn.onlinegdb.com/c%2B%2B_functions