Ask the user from the console, when you finish entering data, ask if you want to enter another data, when answering that "si"
repeats the cycle.
Ask the user from the console, when you finish entering data, ask if you want to enter another data, when answering that "si"
repeats the cycle.
Before the cycle declares a pair of variables, a string that takes the answer and a bool that takes the yes.
bool bandera = false;
string respuesta;
do{
//Lo que necesitas en tu ciclo
bandera = true;
Console.WriteLine("¿Desea algún dato nuevo? Si/No");
respuesta = Console.ReadLine();
if(respuesta.ToLower().Equals("si")) bandera = false;
}while(bandera);
The do while will run while you answer if
Here you can giarte with something like this.
public void Add()
{
Console.WriteLine("Introduzca un texto");
String texto;
texto=Console.ReadLine();
Console.WriteLine("El texto introducido es: " + texto);
Console.WriteLine("Desea introducir otro texto");
String Opcion;
Opcion=Console.ReadLine();
if(Opcion == "Si")
{
Add();
}
}