Doubt on bits Find sum of different corresponding bits for all pairs

how many bit does an INT_MAX have ?
how many Bit does long long int has?
question–>
https://practice.geeksforgeeks.org/problems/find-sum-of-different-corresponding-bits-for-all-pairs4652/1#

code–>
Coding Blocks IDE

Coding Blocks IDE
Coding Blocks Online IDE | Run and check your code

here we have do 64 or 32 in the first loop

INT_MAX +1 is 2147483647+1
Long long is 9223372036854775807 ( 263-1 )
you havent shared any code


here is the code

so integer have 32 bits and ong long int has 64 bits

1 Like