using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int secret; int guess; int count; Console.Write("Player 1: Enter secret: "); secret = int.Parse(Console.ReadLine()); for (count = 0; count < 3; count++) { Console.Write("Player 2: Enter guess: "); guess = int.Parse(Console.ReadLine()); if(guess == secret) { Console.WriteLine("Player 2 has won"); break; // Leave loop immediately because player 2 doesn't need a another guess } } Console.ReadKey(); // Pause } } }