To get data type information based on value in c#

Jitendrasoft09
Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 594
using System;

class JkExample {

static void Main(string[] args) {

Type t1 = 23.GetType();
Console.WriteLine("Value: 23 - Type: {0}", t1);


Type t3 = 2017.2.GetType();
Console.WriteLine("Value: 2017.2 - Type: {0}", t3);


Console.ReadLine();
}
}

Comments or Responses

Login to post response