+ 1

Why we have use int

9th Aug 2017, 4:00 PM
Diksha
Diksha - avatar
6 Answers
+ 2
int is integral, we are using it because c++ not anderstanding that is string or number
9th Aug 2017, 4:03 PM
David
David - avatar
+ 2
besite int ther is float
9th Aug 2017, 4:04 PM
David
David - avatar
+ 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.
9th Aug 2017, 4:57 PM
Kirk Schafer
Kirk Schafer - avatar
+ 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
9th Aug 2017, 4:03 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 1
besides int you can use float
9th Aug 2017, 4:06 PM
David
David - avatar
+ 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)
9th Aug 2017, 5:35 PM
S C