fork download
  1. // Eric Bernal Chapter 2, P. 81 #1 CS1A
  2. /******************************************************************************
  3.  Calculate the total
  4. *_______________________________________________________________________________
  5. This program will calculate the total sum of two numbers.
  6.  
  7. Computation is based on this formula:
  8. Sum = 62 + 99
  9. *_______________________________________________________________________________
  10. INPUT
  11. x = 62
  12. y = 99
  13.  
  14. OUTPUT
  15. Sum of both variables
  16. *
  17. *******************************************************************************/
  18.  
  19. #include <iostream>
  20. using namespace std;
  21.  
  22. int main() {
  23. // Program Input Variables
  24. int x = 62;
  25. int y = 99;
  26. // Program Output Variables
  27. int sum = x + y;
  28.  
  29. // output result
  30. cout << "The sum is " << sum << endl;
  31.  
  32. return 0;
  33. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
The sum is 161