fork download
  1. //Andrew Alspaugh CSC5 Chapter 2, P. 81, #1
  2. //
  3. /***************************************************************************
  4. *
  5. * COMPUTE TOTAL OF TWO NUMBERS
  6. *___________________________________________________________________________
  7. * This program takes two numbers and adds them
  8. * Formula for computation is x+y = Total
  9. * __________________________________________________________________________
  10. *INPUT
  11. * x: 62
  12. * y: 99
  13. *
  14. * OUTPUT
  15. * Total = x+y
  16. *
  17. *****************************************************************************/
  18. #include <iostream>
  19. using namespace std;
  20. int main()
  21. {
  22.  
  23. int x=62, y=99, //INPUT - BOTH 62 AND 99
  24. total = x + y; //OUTPUT - TOTAL OF 62 AND 99
  25.  
  26.  
  27. cout << "Total is: " << total << endl;
  28. return 0;
  29.  
  30. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
Total is: 161