switch(x)
{
case 0:
Console.Write("You typed zero");
break;
case 1 :
case 9 :
Console.Write("n is a perfect square");
break;
case 2 :
Console.Write("n is a prime number");
Console.Write("n is an even number");
break;
case 3:
case 5:
case 7:
Console.Write("n is a prime number");
break;
case 4 :
Console.Write("n is a perfect square");
Console.Write("n is an even number");
break;
case 6 :
case 8 :
Console.Write("n is an even number");
break;
}
int x=10;
switch (x)
{
case 2 :
Console.Write("1");
break;
case 22:
Console.Write("2");
break;
}
if(x<2 || x>20)
Console.Write("1");
i want check x if < 2 and > 20
it is not possible but x is < 2 Or x > 20 is possible.
there is no number that is less than 2 and gather than 20.
Please vote and Accept Answer if it Helped.