diff --git a/Lesson_2/Task_2/Program.cs b/Lesson_2/Task_2/Program.cs index febdcbc..c575e00 100644 --- a/Lesson_2/Task_2/Program.cs +++ b/Lesson_2/Task_2/Program.cs @@ -21,14 +21,14 @@ int maximum; while (true) { Console.Write("Enter minimum age: "); - if (int.TryParse(Console.ReadLine(), out minimum) || minimum >= 0 || minimum <= 130) + if (int.TryParse(Console.ReadLine(), out minimum) && minimum >= 0 && minimum <= 130) break; } while (true) { Console.Write("Enter maximum age: "); - if (int.TryParse(Console.ReadLine(), out maximum) || maximum >= minimum || maximum <= 130) + if (int.TryParse(Console.ReadLine(), out maximum) && maximum >= minimum && maximum <= 130) break; }