Sunday, 13 June 2010

Get the type of variable

using System;

class Vars

{

static void Main()

{

var x = 100;

Console.WriteLine(x.GetType());

var s = "Hello";

Console.WriteLine(s.GetType());

var b = true;

Console.WriteLine(b.GetType());

}

}

starting program

class Example

{

static void Main()

{

System.Console.WriteLine("First C# Program");

}

}