A variable refers to a storage location in the computer’s memory that one can set aside to save, retrieve, and manipulate data.
Variables are denoted by a name.
int Data Type
int is a type for storing integer (whole) numbers.
double Data Type
double is a type for storing floating point (decimal) numbers.
C++ supports arithmetic operators for:
%modulo (yields the remainder)
std::cin, which stands for “character input”, can read user input from the keyboard.
Here, the user can enter a number, press enter, and that number gets stored in the variable
Chaining the Output
std::cout can output multiple values by chaining them using the output operator
Here, the output would be
char Data Type
char is a type for storing individual characters. Characters are wrapped in single quotes.
string Data Type
std::string is a type for storing text strings. Strings are wrapped in double quotes.
bool Data Type
bool is a type for storing
false boolean values.