What is the reason for explicitly declaring L or UL to long values?

If we donot declare a value explicitly then it uses the first data type available for it.

Some examples:

int a = 2; //  2’s data type is int.

long a = 2; // 2’s data type is int.

In both the above cases there will not be any problem.

but what if,,,

unsigned long long a = 21< 36;

as in the above case 1 has int type but we are trying to shift it 36 bits left, and as we all know an int is not that long, so it will overflow.

That’s the reason it’s a good practice to write,

unsigned long long a = 1ULL <  36;