// Example 1int age; // age is a variable of type int (integer)// two double variablesdouble height;
double weight;
// Example 2int age = 32; // integer variable holding 32double height; // unassigned variablefloat pi = 3.14; // new float variablefloat pi_squared = pi * pi; // new float variable
height = (5 * 30.48) + (10 * 2.54); // assigs a value to height// Example 3int a = 2;
constint b = 3; // more readableintconst c = 5; // alternative form
a = 6; // ok
b = 6; // error (b cannot be modified)// Example 4double height = 58.0;
double weight = 155.2;
auto bmi = weight / (height * height); // inferred type (double)