Declaring Variables
Floating Point Numbers
To use a variable containing a decimal, we must use one of the following data types.
Declaring a float or double has the same syntax as int.
float sampleVariable = 99.23;
or
double sampleVariable = 99.23;
* The difference is the amount of memory it takes up.
float sampleVariable = 99.23;
or
double sampleVariable = 99.23;
* The difference is the amount of memory it takes up.