Function to check if a number is Armstrong or not
bool isArmstrong ( int x , int n ) { int sum1 = 0 ; int temp = x ; while ( temp > 0 ) { int digit = temp % 10 ; sum1 += ( int ) pow ( digit , n ) ; temp /= 10 ; } return sum1 == x ; }