write a java program to find the armstrong number between 0 to 100
Answers
Answered by
4
Explanation:
public class Armstrong
{
public static void main(String[] args)
{
int n, count = 0, a, b, c, sum = 0;
System.out.print("Armstrong numbers from 1 to 1000:");
for(int i = 1; i <= 1000; i++)
{
n = i;
while(n > 0)
{
b = n % 10;
sum = sum + (b * b * b);
n = n / 10;
}
if(sum == i)
{
System.out.print(i+" ");
}
sum = 0;
}
}
}
please don't forget to mark this as brainliest.
thankyou
Answered by
0
Answer:
while i > = 0
i = i - 1
i % i = 10
Similar questions