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
Math,
6 months ago
Social Sciences,
6 months ago
Science,
1 year ago
Psychology,
1 year ago
Hindi,
1 year ago