fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int& msub(int& a , int& b){
  5. int c = a - b ;
  6. return c ;
  7. }
  8.  
  9. int main() {
  10.  
  11. int a = 5, b=4, c=2;
  12. int r = msub(a, msub(b,c));
  13. cout << "Should be 3: "<<r<<endl;
  14.  
  15. // your code goes here
  16. return 0;
  17. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
Should be 3: 0