Example by: Ira Oldham, Reference: This is only a sample, not part of CIS16B
The + operator is a binary operator, with two operands, one to the left and one to the right of the + operator. This expression evaluates to the sum of the two operands.
1 int a = 4; 2 int b = 5; 3 int c; 4 c = a + b; 5 cout << "a: " << a << ", b: " << b << ", c: " << c << endl;
a: 4, b: 5, c: 9
We have seen that the + operator is used in an expression to find the sum of two values.