Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- float func(float x)
- {if ((x + 2) <= 1) return pow(x, 2);
- else if (1 < (x + 2) < 10) return 1 / (x + 2);
- else return (x + 2);}
- int main()
- {float a,b,h,x;
- cin>>a;
- cin>>b;
- cin>>h;
- cout<<"x\tfunc(x)\n"<<endl;
- for(x=a; x<=b; x+=h)
- cout<<x<<"\t"<<func(x)<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement