public static void main(String[] args) { long targetNumber, guessNumber; targetNumber = 34; System.out.println("Target Number Is: " + targetNumber); do { guessNumber = (int) (Math.ceil(Math.random() * 100)); System.out.println("Guess Number Is: " + guessNumber); } while (true); if (guessNumber == targetNumber) { // my compiler is displaying this part as "Unreachable statement" System.out.println("\n"); System.out.println("Match Number Is: " + guessNumber); System.exit(0); } } }
why?if (guessNumber == targetNumber) { // my compiler is displaying this part as "Unreachable statement"