ulong keyword in C#
Keywords are the words in a language that are used for some internal process or represent some predefined actions. ulong is a keyword that is used to declare a variable which can store an unsigned integer value from the range 0 to 18,446,744,073,709,551,615. It is an alias of System.UInt64.
ulong keyword occupies 8 bytes (64 bits) space in the memory.
ulong variable_name = value;
Input: num: 223 Output: num: 223 Size of a ulong variable: 8 Input: num = 0 Output: Type of num: System.UInt64 num: 0 Size of a ulong variable: 8
- If we input number beyond the range, it shows error-
Integral constant is too large
- If we input wrong value for eg. -34, it shows error-
Constant value `-34' cannot be converted to a `ulong'
num: 223 Size of a ulong variable: 8
Type of num: System.UInt64 num: 0 Size of a ulong variable: 8 Min value of ulong: 0 Max value of ulong: 18446744073709551615