Search This Blog

Sunday, January 17, 2010

Switch case from C#:

using System;
using System.Collections.Generic;
using System.Text;

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

int i = 0;
switch (i+(-1*i) )
{
case (0):
Console.WriteLine("0");
break;
case (1):
Console.WriteLine("1");
break;
default :
Console.WriteLine("other than 0 & 1");
break;
}
Console.ReadKey();

}
}
}

No comments:

Post a Comment