+ 3

I don't understand this -2147483648 to 2147483647, (c++ int data types)

Its size is usually 4 bytes. Meaning, it can store values from -2147483648 to 2147483647.

13th Sep 2020, 10:14 AM
Angus👑
Angus👑 - avatar
3 Answers
+ 4
As you might be knowing that numbers are stored in memory as their binary representation, so the largest number that we can create would be when all the bits of reserved memory are 1. Which in case of 4bytes is 2147483647.
13th Sep 2020, 10:26 AM
Arsenic
Arsenic - avatar
+ 4
Angus👑 Int size 4bytes.. (4*8=32bits) So maximum value it can store is 2147483647 That is filled with all ones in 31 bits. 1 last bit is for Sign + or -. So 01111111 11111111 11111111 11111111 max value.=2147483647 Min value is 11111111 11111111 11111111 11111111 = - 2147483648
13th Sep 2020, 10:57 AM
Jayakrishna 🇼🇳
+ 2
Arsenic can u provide a good website where I can apprehend more and please with examples also thank u for this
13th Sep 2020, 10:35 AM
Angus👑
Angus👑 - avatar