using System;
namespace Conditional_Statements2
{
class Program
{
static void Main(string[] args)
{
int age;
Console.WriteLine("Enter Your Age");
age = Convert.ToInt32(Console.ReadLine());
switch (age)
{
case 1:
case 2:
Console.WriteLine("Go to Day Care");
break;
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
Console.WriteLine("Go to Primary School");
break;
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
Console.WriteLine("Go to Secondary School");
break;
case 17:
case 18:
Console.WriteLine("Go to College");
break;
case 19:
case 20:
case 21:
case 22:
Console.WriteLine("Go to University");
break;
default:
goto outofswitch;
}
outofswitch:
Console.WriteLine("Go to Work you have enough education");
Console.ReadKey();
}
}
}
namespace Conditional_Statements2
{
class Program
{
static void Main(string[] args)
{
int age;
Console.WriteLine("Enter Your Age");
age = Convert.ToInt32(Console.ReadLine());
switch (age)
{
case 1:
case 2:
Console.WriteLine("Go to Day Care");
break;
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
Console.WriteLine("Go to Primary School");
break;
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
Console.WriteLine("Go to Secondary School");
break;
case 17:
case 18:
Console.WriteLine("Go to College");
break;
case 19:
case 20:
case 21:
case 22:
Console.WriteLine("Go to University");
break;
default:
goto outofswitch;
}
outofswitch:
Console.WriteLine("Go to Work you have enough education");
Console.ReadKey();
}
}
}
Comments
Post a Comment