Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement