fork download
  1. //Amari Mosley CSC5 Chapter 2, P. 81, #1
  2. //
  3. /**************************************************************
  4.  *
  5.  * COMPUTING SUM OF TWO NUMBERS
  6.  * ____________________________________________________________
  7.  * This program computes the sum of two integers: 62 and 99.
  8.  
  9.  * Computation is based on the formula:
  10.  * Sum = Integer 1 + Integer 2
  11.  * ____________________________________________________________
  12.  * INPUT
  13.  * num1 : Integer 1
  14.  *
  15.  * num2 : Integer 2
  16.  *
  17.  * OUTPUT
  18.  * sum : Sum of Integer 1 + Integer 2
  19.  *
  20.  **************************************************************/
  21. #include <iostream>
  22. #include <iomanip>
  23. using namespace std;
  24.  
  25. // Defining Main Function
  26. int main()
  27.  
  28. {
  29. // Defining Integer Variables
  30. int num1, num2, sum;
  31.  
  32. // Assigning Values of Variables num1 and num2
  33. num1 = 62, num2 = 99;
  34.  
  35. //Computing Sum of Values
  36. sum = num1 + num2;
  37.  
  38. //Final Sum Display
  39. cout << "The sum of " << num1 << " and " << num2 << " is "<< sum;
  40. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
The sum of 62 and 99 is 161