using System;
class Program
{
public static void Main()
{
Console.WriteLine("please Choose your city Name where you would like to visit");
Console.WriteLine("Press 1 for Delhi");
Console.WriteLine("Press 2 for Bangaluru");
Console.WriteLine("Press 3 for Mumbai");
Console.WriteLine("Press 4 for Mysore");
int userChoice=int.Parse(Console.ReadLine());
switch (userChoice)
{
case 1:
Console.WriteLine("Welcome to Delhi");
Console.WriteLine("Capital City of India");
break;
case 2:
Console.WriteLine("Welcome to Bangaluru");
Console.WriteLine("IT Hub of India");
Console.WriteLine("We have free trip to Mysore");
Console.WriteLine("Press Yes If you are Interested");
string userDecision = Console.ReadLine().ToUpper();
if (userDecision == "YES")
{
goto case 4;
}
break;
case 3:
Console.WriteLine("Welcome to Mumbai");
Console.WriteLine("Financial City of India");
break;
case 4:
Console.WriteLine("Welcome to Mysore");
Console.WriteLine("Historic City of India");
break;
default:
Console.WriteLine("You Enter Invalid Option. Plz Try again...");
break;
}
}
}
class Program
{
public static void Main()
{
Console.WriteLine("please Choose your city Name where you would like to visit");
Console.WriteLine("Press 1 for Delhi");
Console.WriteLine("Press 2 for Bangaluru");
Console.WriteLine("Press 3 for Mumbai");
Console.WriteLine("Press 4 for Mysore");
int userChoice=int.Parse(Console.ReadLine());
switch (userChoice)
{
case 1:
Console.WriteLine("Welcome to Delhi");
Console.WriteLine("Capital City of India");
break;
case 2:
Console.WriteLine("Welcome to Bangaluru");
Console.WriteLine("IT Hub of India");
Console.WriteLine("We have free trip to Mysore");
Console.WriteLine("Press Yes If you are Interested");
string userDecision = Console.ReadLine().ToUpper();
if (userDecision == "YES")
{
goto case 4;
}
break;
case 3:
Console.WriteLine("Welcome to Mumbai");
Console.WriteLine("Financial City of India");
break;
case 4:
Console.WriteLine("Welcome to Mysore");
Console.WriteLine("Historic City of India");
break;
default:
Console.WriteLine("You Enter Invalid Option. Plz Try again...");
break;
}
}
}
No comments:
Post a Comment