Witam
Zaczynam się uczyć i potrzebuję małej podpowiedzi ;)
Dlaczego taki kod działa :
namespace qwhile
{
class Program
{
static void Main(string[] args)
{
string a;
do
{ Console.WriteLine("Podaj znak + lub - :");
a = Console.ReadLine();
}
while (a == "+" || a =="-");
Console.WriteLine("okk");
Console.ReadLine();
}
}
}
a taki już nie :?
namespace qwhile
{
class Program
{
static void Main(string[] args)
{
string a;
do
{ Console.WriteLine("Podaj znak + lub - :");
a = Console.ReadLine();
}
while (a != "+" || a !="-");
Console.WriteLine("okk");
Console.ReadLine();
}
}
}
Chodzi oczywiście o warunek WHILE, jak zrobić by pierwszy przykład działał ?
Proszę o naprowadzenie w odpowiednim kierunku ;)