title: Im supposed to take a number entered from user to check if the input is a prime number or not.(I started very recently so please dont judge).)
body: <p>Please try to base examples or explanations off of my code as I am a beginner there are many concepts that I do not understand.</p>
  <pre><code>import java.util.*;
  public class Main{    
  public static void main(String[]args){
  while(true) {  
      int i;
      int x;
      System.out.println(&quot;Enter a number.&quot;);
      Scanner input = new Scanner(System.in);
      int z = input.nextInt();
      x=z/2;      
  }
  
  for(int i=2; i &lt;= int x ; i++)
  if(z%i==0||z==0||z==1){
      System.out.println(&quot;Not prime number&quot;);
      }
  else{
      System.out.println(&quot;Prime Number&quot;);
      }  
  }           
  
      
  </code></pre>