(int N, int k)
| 35 | } |
| 36 | |
| 37 | public static boolean isArmstrongNumber(int N, int k) { |
| 38 | long powerSum = 0; |
| 39 | int n = N; |
| 40 | |
| 41 | while (n != 0) { |
| 42 | int rem = n % 10; |
| 43 | |
| 44 | powerSum += (int) Math.pow(rem, k); |
| 45 | |
| 46 | n /= 10; |
| 47 | } |
| 48 | System.out.println(powerSum); |
| 49 | return (powerSum==N); |
| 50 | } |
| 51 | |
| 52 | } |
nothing calls this directly
no outgoing calls
no test coverage detected