0
Limit of Integer variable.
what is the limit of integer variable in C++ ?
2 Answers
+ 3
int variable takes 4 bytes
1byte = 8 bits
4 times 8 is 32
each bit can be either 1 or 0
so 2^32 is all the possible states an int can take
take into consideration the negative numbers and you will be left with
(2^31)-1 which is 2,147,483,648
TL;DR: roughly 2.15 billion
0
for signed integer :
-2147483648 to 2147483647