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 ."); } }
- Write a program to check Number is Prime or Not in java?
- Write a program to print fibonacci number in java ?
- Write a program for Reverse Of String in java?
- Write a program for Reverse Of Number in java?
- Write a program for palindrome of String in java?
- Write a program for LCM of two numbers in java?
- Write a program for LCM of N numbers in java?
- Write a program to number is perfect or not in java?
- Write a program which converts the Binary number to Decimal in java?
- Write a program to the second largest number in java?
- Write a program for swiping of two number without using the third variable in java?
- Write a program for multiplication of two number without using the multiplication operator in java?
- Write a program for addition of two numbers without using the addition operator in java?
- Write a program for A.P Series in java?
- Write a program which converts an ArrayList into Array in java?
- Write a program for binary search in java?
- Write a program which prints duplicate number from Array in java?
- Write a program to find the repeated character and how many times it repeated in a string in java?
- Program to find the missing number in the array.
- Program to find the largest and smallest number in an array.
- Program to swap two strings without using the third variable in java.
- Program to get Host Name and IP address in Java.
- Program to count number of object created in java.
- Program to define custom exception in Java.
- Program to find sum of digits in String.
- Program to print Floyds triangle in Java.
- Program to remove duplicate characters from String in Java.
- Program to check two strings are an anagram or not in java.
- Program to print numbers 1 to 10 without using loop in java.
- Program to count characters in each word of given String.
- Program to check given character is alphabet or not in java.
- Program to check given year is a leap year or not in java.
- Program to print alphabet in java.
- Program to find the duplicate words and its count.
- Program to create an immutable class in java.
- Program to find the sum of digits of a number in java.
- Program to print prime numbers in java from 1 to n.
- Program to find sum of first n numbers in java.
- Program to reverse an array in java.
- Program to print the first character of each word.
- Program to count the frequency of each character for a given string.