fork download
  1. //Matthew Santos CS1A Chapter 2, P. 81, #1
  2. /*******************************************************
  3.  *
  4.  * FIND SUM OF TWO NUMBERS
  5.  * _____________________________________________________
  6.  *
  7.  * This code stores the integers 62 and 99 in variables
  8.  * and stores and outputs the sum of them as a total.
  9.  * _____________________________________________________
  10.  *
  11.  * INPUT
  12.  * num1 : 62
  13.  * num2 : 99
  14.  *
  15.  * OUTPUT
  16.  * total : 161
  17.  *
  18.  * ****************************************************/
  19.  
  20. #include <iostream>
  21. using namespace std;
  22.  
  23. int main() {
  24.  
  25. //Establish values
  26. int num1 = 62;
  27. int num2 = 99;
  28. int total;
  29.  
  30. //Add two numbers
  31. total = num1 + num2;
  32.  
  33. //Output sum
  34. cout << "Total: " << total;
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Total: 161