write a program of neon,armstrong,happy number in java using loops (any type )
{urgently needed}
Answers
Answered by
0
Answer:
vdhhdfhggddgdggddvgvggdgggddgdggdfdgdgdggfddggdgddhdhduydydururururuuryrururuururur
Answered by
0
class Armstrong {
public static void main(String[] args) {
int number = 371, originalNumber, remainder, res = 0;
originalNumber = number;
while (originalNumber != 0)
{
remainder = originalNumber % 10;
res += Math.pow(remainder, 3);
originalNumber /= 10;
}
if(res == number)
System.out.println(number + " is an Armstrong number.");
else
System.out.println(number + " is not an Armstrong number.");
}
}
Result :- 371
Similar questions
History,
5 months ago
Math,
5 months ago
Science,
11 months ago
Psychology,
11 months ago
Hindi,
1 year ago