Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // your name, program description
- #include <iostream>
- using namespace std;
- double y; // a global variable
- double g(double x){ return x*x - y; } // function definition
- int main()
- {
- double x;
- cout << "Enter x: ";
- cin >> x;
- cout << "Enter y: ";
- cin >> y;
- double z = g(x);
- cout << "g(x) = " << z << 'n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement