fork(4) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i;
  8. int j;
  9. int k;
  10.  
  11. // read i and j from the user
  12.  
  13. cin >> i;
  14. cin >> j;
  15.  
  16. // assign to k the sum of i and j
  17.  
  18. k = i + j;
  19.  
  20. // print out the value of k
  21.  
  22. (cout << i) << " + " << j << " = " << k << endl;
  23.  
  24. // print out the result of i-j
  25.  
  26. ((cout << i) << " - ") << j << " = " << i-j << endl;
  27.  
  28. // return 0 from the main function
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0.02s 2728KB
stdin
Standard input is empty
stdout
-1081618632 + -1081618484 = 2131730180