Professional Documents
Culture Documents
• Example:
#include <iostream>
total_sales Yes
Initializing a variable
– Gives an initial value to a variable at the time
it is defined
– Some or all of the variables being defined can
be initialized
int length = 12;
int width = 7, height = 5, area;
- subtraction ans = 7 - 3; 4
* multiplication ans = 7 * 3; 21
/ division ans = 7 / 3; 2
% modulus ans = 7 % 3; 1