Get the TypeCode for value type UInt32 in C#

CsharpServer Side ProgrammingProgramming

To get the TypeCode for value type UInt32, the code is as follows −

Example

 Live Demo

using System;
public class Demo {
   public static void Main() {
      uint val1 = 55;
      uint val2 = 100;
      TypeCode type1 = val1.GetTypeCode();
      TypeCode type2 = val2.GetTypeCode();
      Console.WriteLine("Typecode for val1 = "+type1);
      Console.WriteLine("Typecode for val2 = "+type2);
   }
}

Output

This will produce the following output −

Typecode for val1 = UInt32
Typecode for val2 = UInt32

Example

Let us see another example −

 Live Demo

using System;
public class Demo {
   public static void Main() {
      uint val1 = UInt32.MinValue;
      uint val2 = 0;
      TypeCode type1 = val1.GetTypeCode();
      TypeCode type2 = val2.GetTypeCode();
      Console.WriteLine("Typecode for val1 = "+type1);
      Console.WriteLine("Typecode for val2 = "+type2);
   }
}

Output

This will produce the following output −

Typecode for val1 = UInt32
Typecode for val2 = UInt32
raja
Published on 11-Dec-2019 10:03:44
Advertisements