0

Hello.How to develop a program that calculates the value of a function?

[-1,1] {sinx,-2<=x<=-1 {cose^x,-1<x<=0 y={tg lnx, 0<x<=1 {ctgx,1<x<=2

5th Oct 2017, 6:17 PM
Igor Baburin
Igor Baburin - avatar
1 Answer
+ 7
E.g. double f(int x) { if (x <= -1) return (sin(x)); if (x <= 0) return (cos(x)); // more } // call in main int main() { std::cout << f(1); std::cout << f(2); } http://www.cplusplus.com/reference/cmath/
5th Oct 2017, 6:55 PM
Hatsy Rei
Hatsy Rei - avatar