Variables and Data Types

C++ supports multiple data types like int, float, char, bool, and double.

int age = 25;
float height = 5.9;
char grade = 'A';
bool isStudent = true;

Variables must be declared with their data type. C++ is statically typed, meaning types are checked at compile time.

← PrevNext →