Getting datatype of a variable in C#

Now you can know the datatype of a variable easily.
Remember that the variable must be assigned before using GetType() function.

C# will only look the value assigned and provide the result.

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            int i=2142324223;

           System.Type tp = i.GetType();

           Console.WriteLine(tp);


           string s = "forget code";

           System.Type tp1 = s.GetType();

           Console.WriteLine(tp1);

            
                        
        }

    }
}


Output:
System.Int32
System.String



..