Programming Fundamentals/Variable Examples C++

Overview
The following examples demonstrate data types, arithmetic operations, and input in C++.

Output
Integer i = 1234567890 Real r = 1.23457 String s = string Boolean b = 1

Discussion
Each code element represents:
 * begins a comment
 * includes standard input and output streams
 * includes standard string streams
 * allows reference to,  , and   without writing  ,  , and.
 * begins the main function, which returns an integer value
 * begins a block of code
 * defines an integer variable named i
 * ends each line of C++ code
 * defines a double floating-point variable named d
 * defines a string variable named s
 * defines a Boolean variable named b
 * assign literal values to the corresponding variables
 * is standard output
 * directs the next element to standard output
 * ends the current line
 * returns the value 0 from main, indicating the main function completed successfully
 * ends a block of code

Output
a = 3 b = 2 a + b = 5 a - b = 1 a * b = 6 a / b = 1 a % b = 5

Discussion
Each new code element represents:
 * represent addition, subtraction, multiplication, division, and modulus, respectively.

Output
Enter Fahrenheit temperature: 100 100° Fahrenheit is 37.7778° Celsius

Discussion
Each new code element represents:
 * reads the next integer from standard input and assigns the value to the fahrenheit variable