The code simply declares the variables lower
, upper
, and step
, reserving space in memory to allow data to be stored in these variables. Unless the variable is declared in the global scope, it does not assign any value to them. In C++, the values of such uninitialized variables are undefined; in practice, this means that these variables will have values that are effectively random, determined simply by whatever leftover values exist in the memory locations reserved for these variables.
If you want to assign values to multiple variables as they are declared, you can put the assignments into the same line as the declaration:
int lower = 0, upper = 100, step = 1;
Alternatively, you can assign them values later, perhaps from an input statement:
int lower, upper, step;
cin >> lower >> upper >> step;