+ 1
what's the difference between double and int?
3 Respostas
+ 2
double means it will contains float number like
1.5,65.76 and -66.99 etc
it has 64 bit size
int is contains integers like
1,4,3 etc
it has 32 bit size
+ 2
An int (integer) can only be a full numerical variable which has no decimal place, while double is a numerical variable that allows you to input numbers with decimal places.
E.g.
int x = 3; //full number
double y = 3.3; // not a full numbers contains decimal place
+ 2
double has decimals while int does not, also int operations get automatically rounded (down) if you don't place the result into a double variable