how to use switch case for a range of number

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="color:#0600ff As above...  could this statement work ?  case (0 - 500) <span style="color:#0600ff
<pre>public void Switch(int num)
{
switch (num)
{
case (0-500):
// belong to 0-500;
break;
case (501-1000):
// belong to 501-1000;
break;
}
}[/code]
<br/> <span style="color:#000000

View the full article
 
Back
Top