Unsigned long long int

Hi everyone, I am confused with how should we choose between the following based on any input/output in any problem:
-> int
-> long int
-> long long int
->unsigned long long int

Thanks in advance!!

See the range till which it can store and unsigned is for only +ve values

1 Like
  • short and int: -32,767 to 32,767
  • unsigned short int and unsigned int: 0 to 65,535
  • long int: -2,147,483,647 to 2,147,483,647
  • unsigned long int: 0 to 4,294,967,295
  • long long int: -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807
  • unsigned long long int: 0 to 18,446,744,073,709,551,615.

Refer to https://stackoverflow.com/questions/6462439/whats-the-difference-between-long-long-and-long