+ 1
Why we have use int
6 Answers
+ 2
int is integral, we are using it because c++ not anderstanding that is string or number
+ 2
besite int ther is float
+ 2
Just in case you mean "why do you write it in the first place"...
...because you must *declare* the data type for a variable in c++. By declaring what you intend to do, the compiler can determine how much space to set aside for the variable, and what sorts of rules must be followed.
+ 1
because we want to use regular numbers
In C, the integer (for 32 bit machine) is 32 bits, and it ranges from -32768 to +32767. In Java, the integer is also 32 bits, but ranges from -2,147,483,648 to +2,147,483,647
+ 1
besides int you can use float
+ 1
int means 'integer' it contains whole numbers. By defining a number as int we save space in memory because fewer bits need to be stored (in contrast to double)