Check my code and please correct it according to question

import java.util.Scanner;

public class Reversenumber {

public static void main(String[] args)
{
  Scanner scn= new Scanner(System.in);
  int N=1000000001;
  while(N<0 || N > 1000000000) {
   N=scn.nextInt();
  }
  int reverse=0;
  int sum = 0;
  while(N % 10 != 0)
	  
  {
	  int rem = N % 10;
	  sum =sum*10 + rem;
	  N = N / 10;
      reverse=sum;
  }
  System.out.println(reverse);
}

}

While condition is wrong. What if there’s a 0 in the number in between non-zero digits

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.