An int is a whole number like 47 without a decimal point. You can't have 4.5 babies or loop 32.9 times. You can have $25.76 if you use a float. So when you create your program, you must decide which type to use.
Why not Just Use Floats?
This is what some scripting languages do? Because it's inefficient, floats take up more memory and are generally slower than ints. Also you cannot easily compare two floats to see if they are equal like you can with ints.To manipulate numbers you have to store them in memory. Because the value can be easily changed, it's called a variable.
- Read more about variables in What is a Variable?
Here's an example.
int Counter =0;You'll notice that the Counter variable is set to 0. This is an optional initialization. It's a very good practice to initialize variables. If you don't initialize and then use them in code without having set an initial value, the variable will start with a random value that may 'break' your code. The value will be whatever was in memory when the program was loaded.
float BasicSalary;
On the next page : Learn more about ints.

