Check Input Data Type In Console Application C#
<p>How to check input data type in c# Console application..</p>

<pre><code>Class A
{

 object o=Console.ReadLine();
 //logic here to check data type and print
//e.g type of Integer, Decimal, String etc

}
</code></pre>

<p>if i give input of <code>23</code> then it'll print <code>'Integer'</code></p>

<p>if i give input of <code>23.9</code> then it'll print <code>'Decimal'</code></p>

<p>if i give input of <code>"abcd"</code> then it'll print <code>'String'</code></p>

<p>What i'm trying to do is..
Something like</p>

<pre><code>Class A
{
Type t=Typeof(Console.ReadLine().GetType);
Console.WriteLine(t.Name);
}
</code></pre>