write a java program to input 10 numbers in an array and display Armstrong number
Answers
Answered by
1
- public static void main(String[] arg) { int i=100,arm; System. out. println("Armstrong numbers between 100 to 999");
- while(i<1000) { arm=armstrongOrNot(i); if(arm==i)
- System. out. println(i); i++; } }
- int x,a=0; while(num!=0) { x=num%10;
- a=a+(x*x*x); num/=10 ; } return a;
Armstrong Number In Java Program - 5 Simple Ways - Java Tutoring
Answered by
1
Answer:
153= 1*1*1 + 5*5*5 + 3*3*3 // 153 .
Similar questions