fork download
  1. /******************************************************************************************
  2. * Name: Marcelo Vargas
  3. * Chapter 2 Homework
  4. * Class: CSC5
  5. * #1
  6. *
  7. * COMPUTE THE SUM OF TWO NUMBERS
  8. *
  9. * This program calculates the sum of 62 + 99
  10. * _________________________________________________________________________________________
  11. * INPUT
  12. * num1 :first interger (62)
  13. * num2 :second interger(99)
  14. *
  15. * OUTPUT
  16. * total = :the sum of num1 and num2
  17. *
  18. *******************************************************************************************/
  19. //importing "iostream" from stream library
  20. #include <iostream>
  21. using namespace std;
  22.  
  23. int main()
  24. {
  25. // Declare variables
  26. int num1 = 62;
  27. int num2 = 99;
  28.  
  29. // Calculates the sum of both numbers
  30. int total = num1 + num2;
  31.  
  32. // Output the total
  33. cout<<"The sum of 62 and 99 is " <<total <<endl;
  34.  
  35. return 0;
  36. }
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
The sum of 62 and 99 is 161