Answer:
Check the explanation
Explanation:
In C, int requires 4 butes to sotre a integer number. that means it requires 4*8 = 32 bits. The maximum number can be stored using 32 bits is
[tex](11111111111111111111111111111111)_2[/tex]
The first digit is used for sign. decimal equivalent to this number can be computed as
[tex](1111111111111111111111111111111)_2= 1\times2^{30}+1\times2^{29}+...+1\times2^0[/tex]
=[tex]1\times2^{31}-1[/tex]
= [tex]2147483647-1=2147483646[/tex]
That means int can store a up to 2147483646.
Testing with C code
#include<stdio.h>
int main()
{
int a = 2147483647; // a with max number
printf("%d\n",a);// printing max number
a = a+1;// adding one to the number
printf("%d\n",a);// printing the number after adding one
return 0;
}
THE OUTPUT
$ ./a.out
2147483647
-2147483648