Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. double Calc(double,double);
  5.  
  6. int main() {
  7. double a,b;
  8. cout<<"a= ";
  9. cin>>a;
  10. cout<<"b= ";
  11. cin>>b;
  12. cout<<"Result: "<<Calc(a,b)<<endl;
  13.  
  14. system ("pause");
  15. return 0;
  16. }
  17. double Calc(double a, double b){
  18. double x;
  19. x = 2*((a−b)/(b−a));
  20. return x;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement