title: To check if a number is Armstrong number using java
body: <p>this is my program:</p>
  
  <pre><code>public class ArmstrongNumber {
  
      public static void main(String args[]) {
          int n = 0, temp = 0, r = 0, s = 0;
          Scanner in = new Scanner(System.in);
          System.out.println("Enter a number ");
          if (in.hasNextInt()) {
              n = in.nextInt(); // if there is another number  
          } else {
              n = 0;
          }
          temp = n;
          while (n != 0) {
              r = n % 10;
              s = s + (r * r * r);
              n = n / 10;
          }
  
          if (temp == s) {
              System.out.println(n + " is an Armstrong Number");
          } else {
              System.out.println(n + " is not an Armstrong Number");
          }
      }
  }  
  </code></pre>
  
  <p>output:</p>
  
  <p>Exception in thread <code>"main"</code> <code>java.lang.NoClassDefFoundError</code></p>
  
  <p>I tried it using <code>DataInputStream</code> but still getting same error.</p>