title: Why integer value gets 0 when the limit is exceeded?
body: <p>Why an int becomes zero when it exceed the int limit in java?</p>
  
  <p>Eg:</p>
  
  <pre><code>import java.util.Scanner
  public class MyClass{
  public static void main(Stings [] args){
  Scanner sc = new Scanner(System.in);
  int x = sc.nextInt(); // enter 50 or higher.
  int answer = 1;
  while(x&gt;0){
  answer = answer*x;
  x--;
  }
  System.out.println(answer);
  }
  }
  </code></pre>