Random numbers while loops
<p>I am new to java and i am so close to the answers.i hope that i can have some hints but not the full answer.I will prefer to derive the logic out on my own.</p>

<pre><code>/*
Write a method named makeGuesses that will guess numbers
between 1 and 50 inclusive until it makes a guess of at least 48.
It should report each guess and at the end should report
the total number of guesses made. Below is a sample execution:
*/

guess = 43
guess = 47
guess = 45
guess = 27
guess = 49
total guesses = 5

public void makeGuesses(){
    Scanner sc=new Scanner(System.in);
    Random rnd=new Random();
    int i=1
    int counter=0;

   while(i&gt;=1 &amp;&amp; i&lt;=50){

        i=rnd.nextInt();
        System.out.println("guess = " + i);
         counter++;


    }
    System.out.print("total guesses = "+ counter);
}
</code></pre>

<p>What's wrong with my code?I realised although i fix my i to be between 1 and 50,it still exceeds.</p>
