0
Java program to count armstrong number between 100 to 1000
Pls help me out...
2 Réponses
+ 6
Pls show your attempt...
https://www.sololearn.com/Discuss/1316935/welcome-to-sololearn-forum/
0
public class Amstrong {
public static void main(String[] args) {
int n;
int sum = 0;
int rem;
int count = 0;
System.out.print("Armstrong number between 100 to 1000 :");
for(int i=100;i<=1000;i++){
n = i;
while(n>0){
rem = n % 10;
rem = (rem * rem * rem);
sum = sum + rem;
n = n /10;
}
if(sum == i){
System.out.print("\n"+i);
count++;
}
sum=0;
}
}
}