Int vs Long int

What is the difference between int and long int? Both have the same bytes and range! (4 bytes and range is from -2^31 to (2^31-1)). So if we are using long long int then what’s the use of long int?

@Sharleen-Clement-3051084341644767
Int store -1e9 to 1e9
Long long int store -1e18 to 1e18

What about long int then(not long long int)?

@Sharleen-Clement-3051084341644767 both are same 1e18 but in some compiler long may store less but 1e18 in new one

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.