Armstrong number

An Armstrong number (also called a plus perfect number or narcissistic number) is a number equal to the sum of the nth power of the digits, where n is the quantity of digits in the number.

Check Armstrong Number

import java.util.Scanner;

public class ArmstrongNumber {
	private static boolean checkArmstrong(int number) {
		int temp, remainder, i, counter = 0, result = 0, power;
		temp = number;

		while (temp != 0) {
			temp /= 10;
			counter++;
		}
		temp = number;

		while (temp != 0) {
			remainder = temp % 10;

			power = 1;
			i = counter;
			while (i != 0) {
				power *= remainder;
				i--;
			}

			result += power;
			temp /= 10;

		}

		if (number == result) {
			return true;
		} else {
			return false;
		}
	}

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int number;

		System.out.print("Enter a number to check for armstrong:  ");
		number = reader.nextInt();
		reader.close();

		if (checkArmstrong(number)) {
			System.out.print(number + " is an armstrong number");
		} else {
			System.out.print(number + " is not an armstrong number");
		}

	}
}
Output
Enter a number to check if armstrong number:  8208
8208 is an armstrong number

Armstrong Number Series

import java.util.Scanner;

public class ArmstrongNumberSeries {
	private static boolean checkArmstrong(int number) {
		int temp, remainder, i, counter = 0, result = 0, power;
		temp = number;

		while (temp != 0) {
			temp /= 10;
			counter++;
		}
		temp = number;

		while (temp != 0) {
			remainder = temp % 10;

			power = 1;
			i = counter;
			while (i != 0) {
				power *= remainder;
				i--;
			}

			result += power;
			temp /= 10;

		}

		if (number == result) {
			return true;
		} else {
			return false;
		}
	}

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int max;

		System.out.print("Enter the upper bound to find armstrong numbers:  ");
		max = reader.nextInt();
		reader.close();

		System.out.println("Armstrong Number Series:");
		for (int i = 1; i <= max; i++) {
			if (checkArmstrong(i)) {
				System.out.print(i + " ");
			}
		}
	}
}
Output
Enter the upper bound to find armstrong numbers:  1000
Armstrong Number Series:
1 2 3 4 5 6 7 8 9 153 370 371 407