fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int sum(int a, int b) {
  5. return a + b;
  6. }
  7.  
  8. int main() {
  9. int x, y;
  10. cout << "Enter two numbers: ";
  11. cin >> x >> y;
  12. cout << "Sum = " << sum(x, y);
  13. return 0;
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Enter two numbers: Sum = -637892628