Java Programming Exercises : ArmStrong Number check

An Armstrong number of 3 digit is a number for which sum of cube of its digits are equal to number e.g. 371 is an Armstrong number because 3*3*3 + 7*7*7 + 1*1*1 = 371).

Let's see how to coding:

import java.util.Scanner;

public class AmStrongNumber {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  int num;
  int c1, c2, c3;
  System.out.print("Input a number: ");
  Scanner myScanner = new Scanner(System.in);

  // get input from keyboard
  num = myScanner.nextInt();

  c1 = num / 100;
  c2 = (num % 100) / 10;
  c3 = num % 10;

  if (c1 * c1 * c1 + c2 * c2 * c2 + c3 * c3 * c3 == num) {
   System.out.println("It's ArmStrong Number.");
  }else{
   System.out.println("It's not Armstrong Number.");
  }
 }
}