Previous

C++ Variable.

Next
  • It is a like container.
  • It is used to store data.,and it can store only one value.

In C++ ,there are diffrent type of variables.

for example=>

  • int - store integer (whole number),without decimals.such as 123 or -234.
  • char - store a single characters ,such as 'a' or 'b'.char values are surrounded by single quotes.
  • double -It is store floating point numbers,with decimals,such as 123.432 or -345.564.
  • string - It is store text,such as "Hello coder".String values are surrounded by double quotes.
  • bool - It is stores values with two states: true or false