Professional Documents
Culture Documents
#Include #Include Using Namespace Double Double Int: Iostream Cmath
#Include #Include Using Namespace Double Double Int: Iostream Cmath
#include <cmath>
double func(double);
int main() {
cout << "y = lntgx" << endl;
while(true) {
cout << endl << "enter x which satisfies the condition : nPI < x < nPI + PI /
2, n - int" << endl;
double x;
cin >> x;
try {
double z = func(x);
cout << z << endl;
}
catch (const char* err) {
cout << err << endl;
}
}
return 0;
}
double func(double x) {
double t = x;
int n = -1;
while(t >= 0) {
t -= M_PI;
n++;
}