Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float F(float x)
- {
- if (x <= 5) return x*x+5;
- else if (x >=20) return 1;
- else return 0;
- }
- void F(float x, float &y)
- {
- if (x <= 5) y = x*x+5;
- else if (x >= 20) y = 1;
- else y = 0;
- }
- int main ()
- {
- float x,y,x1,y1;
- cin >> x;
- y1 = F(x);
- F(x,y);
- cout << y << " " << y1 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment