UInt64.GetTypeCode Method in C# with Examples
Last Updated :
01 May, 2019
UInt64.GetTypeCode method is used to get the TypeCode for value type UInt64.
Syntax: public TypeCode GetTypeCode ();
Return Value: This method returns the enumerated constant UInt64.
Below programs illustrate the use of the above discussed-method:
Example 1:
using System;
class GFG {
public static void Main()
{
ulong s1 = 134851223;
TypeCode result = s1.GetTypeCode();
Console.WriteLine( "TypeCode for UInt64 is: {0}" ,
result);
}
}
|
Output:
TypeCode for UInt64 is: UInt64
Example 2:
using System;
class GFG {
public static void Main()
{
result(UInt64.MinValue);
result(UInt64.MaxValue);
}
public static void result( ulong val)
{
TypeCode code = val.GetTypeCode();
Console.WriteLine( "TypeCode for {0} is {1}" ,
val, code);
}
}
|
Output:
TypeCode for 0 is UInt64
TypeCode for 18446744073709551615 is UInt64
Reference:
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...