I\'m creating a C# program for the Currency Converter by console. At the end I would to insert \"Continue? (yes/no)\". Here the user have to chose. I\'ve tried this but it
This should fix your problem: And you should make your variable "risposta" ToLower so that it doesnt matter if you type a small or big letter (y or Y)
float Dollaro = 1.32f, Euro;
float Cambio;
string EuroStr;
string risposta = "Y";
do
{
Console.Write("Euro: ");
EuroStr = Console.ReadLine();
Euro = float.Parse(EuroStr);
Cambio = Dollaro * Euro;
Console.WriteLine("Dollaro: " + Cambio);
Console.WriteLine("Vuoi continuare? (yes/no)");
risposta = Console.ReadLine();
if (risposta.Equals("Y"))
{
Console.WriteLine("Yes");
}
else if (risposta.Equals("N"))
{
Console.WriteLine("No");
}
} while (risposta.ToLower() == "y");