SHARE
TWEET

Untitled

a guest Feb 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // your name, program description
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. double y;       // a global variable
  7.  
  8. double g(double x){ return x*x - y; } // function definition
  9.  
  10. int main()
  11. {
  12.     double x;
  13.     cout << "Enter x: ";
  14.     cin >> x;
  15.     cout << "Enter y: ";
  16.     cin >> y;
  17.     double z = g(x);
  18.     cout << "g(x) = " << z << 'n';
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top