Hem 068WTLAB2
Hem 068WTLAB2
Hem 068WTLAB2
WT LAB 2
import java.util.Scanner;
int factorial = 1;
for (int i = 2; i <= num; i++) {
factorial *= i;
}
while (temp != 0) {
int digit = temp % 10;
sum += Math.pow(digit, 3);
temp /= 10;
}
if (sum == num) {
System.out.println(num + " is an Armstrong number");
} else {
System.out.println(num + " is not an Armstrong number");
}
}
}