armstrong numbers in java

Write a program for Armstrong Numbers in java ?

public class Armstrong {
public static void main(String[] args) {
int sum = 0, temporary, r;
Scanner in = new Scanner(System.in);
System.out.println("Enter a number "); 
int n = in.nextInt();
temporary = n;
while( temporary != 0 )
{
r = temporary%10;
sum = sum + r*r*r;
temporary = temporary/10; 
}
if ( n == sum )
System.out.println("number is an armstrong .");
else
System.out.println(" number is not an armstrong ."); 
}
}

 

  1. Write a program to check Number is Prime or Not in java?
  2. Write a program to print fibonacci number in java ?
  3. Write a program for Reverse Of String in java?
  4. Write a program for Reverse Of Number in java?
  5. Write a program for palindrome of String in java?
  6. Write a program for LCM of two numbers in java?
  7. Write a program for LCM of N numbers in java?
  8. Write a program to number is perfect or not in java?
  9. Write a program which converts the Binary number to Decimal in java?
  10. Write a program to the second largest number in java?
  11. Write a program for swiping of two number without using the third variable in java?
  12. Write a program for multiplication of two number without using the multiplication operator in java?
  13. Write a program for addition of two numbers without using the addition operator in java?
  14. Write a program for A.P Series in java?
  15. Write a program which converts an ArrayList into Array in java?
  16. Write a program for binary search in java?
  17. Write a program which prints duplicate number from Array in java?
  18. Write a program to find the repeated character and how many times it repeated in a string in java?
  19. Program to find the missing number in the array.
  20. Program to find the largest and smallest number in an array.
  21. Program to swap two strings without using the third variable in java.
  22. Program to get Host Name and IP address in Java.
  23. Program to count number of object created in java.
  24. Program to define custom exception in Java.
  25. Program to find sum of digits in String.
  26. Program to print Floyds triangle in Java.
  27. Program to remove duplicate characters from String in Java.
  28. Program to check two strings are an anagram or not in java.
  29. Program to print numbers 1 to 10 without using loop in java.
  30. Program to count characters in each word of given String.
  31. Program to check given character is alphabet or not in java.
  32. Program to check given year is a leap year or not in java.
  33. Program to print alphabet in java.
  34. Program to find the duplicate words and its count.
  35. Program to create an immutable class in java.
  36. Program to find the sum of digits of a number in java.
  37. Program to print prime numbers in java from 1 to n.
  38. Program to find sum of first n numbers in java.
  39. Program to reverse an array in java.
  40. Program to print the first character of each word.
  41. Program to count the frequency of each character for a given string.