Types of Variables in C++ Language

Types of Variables in C++ Language:

(1) In C++ Language, values are stored in variables. There are different types of variables.

  • int: It stores the whole number w/o decimal, eg.: 1, 2, 123, 345.
  • double: It stores whole and decimal numbers, eg.: 1, 2.5, 123.45, 345.
  • char: It stores a single keyword, eg.: A, B, C.
  • string: It stores text or sentences, eg.: Hi, Hello.
  • bool: it stores two values True & False

(2) Refer image as shown.

Types of Variables in C++ sample code

Use of endl in C++ Language
How to Insert a New Line in C++
cout in C++ Language
C++ Data Types– GK Scientist
Built-in types (C++)– Microsoft Docs

Leave a Reply