sir we have declared ln variable as long type and 1000000000 is also in range of long then why are we getting error?
Long data type in data types practical part -2
This is because the literal 10^10 is written in an integer format and the compiler reads it like an integer. But it is out of range for any integer so we have to specify that it is a long number by adding an āLā to it. Just like in float we have to specify the number by adding a decimal place. This error does not come in numbers less than 10^9 because those integers are in the range of int and the long variable can hold any integer value by default.