Single.GetTypeCode Method in C# with Examples Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Single.GetTypeCode method is used to get the TypeCode for value type Single. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Single. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // Single.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // Taking sbyte value float s1 = 56; // Getting the typecode // using GetTypeCode() method TypeCode result = s1.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode for {0} is: {1}", s1, result); } } Output: TypeCode for 56 is: Single Example 2: csharp // C# program to illustrate the // Single.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // using result() Method result(Single.MinValue); result(Single.MaxValue); } // result() method public static void result(float val) { // using GetTypeCode() method TypeCode code = val.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode for {0} is {1}", val, code); } } Output: TypeCode for -3.402823E+38 is Single TypeCode for 3.402823E+38 is Single Reference: https://learn.microsoft.com/en-us/dotnet/api/system.single.gettypecode?view=netstandard-2.1 Comment More infoAdvertise with us Next Article UInt16.GetTypeCode Method in C# with Examples R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Single-Struct Similar Reads SByte.GetTypeCode Method in C# with Examples SByte.GetTypeCode method is used to get the TypeCode for value type SByte. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant SByte. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // SB 1 min read UInt32.GetTypeCode Method in C# with Examples UInt32.GetTypeCode method is used to get the TypeCode for value type UInt32. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant UInt32. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // 1 min read UInt16.GetTypeCode Method in C# with Examples UInt16.GetTypeCode method is used to get the TypeCode for value type UInt16. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant UInt16. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // 1 min read UInt64.GetTypeCode Method in C# with Examples 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: csharp // C# program to illustrate the // 1 min read Single.GetHashCode() Method in C# with Examples Single.GetHashCode() Method is used to return the hash code for this instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of Single.GetHashCode() Method: Example 1: csharp // C# program to demonst 1 min read Int32.GetTypeCode Method in C# with Examples Int32.GetTypeCode method is used to get the TypeCode for value type Int32. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Int32. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // In 1 min read Like