This code includes functions to check whether the entered number is prime or not, armStrong or not, also to print all 3 digit armstrong number The above code includes 3 functions :
- isPrime(): A prime number is a positive integer greater than 1 that has no positive divisors other than 1 and itself. In other words, a prime number is a number that cannot be formed by multiplying two smaller positive integers. For example, 2, 3, 5, 7, 11, and 13 are prime numbers because they have no divisors other than 1 and themselves
- isArmStrong(): An Armstrong number, also known as a narcissistic number, pluperfect digital invariant, or pluperfect digital number, is a number that is equal to the sum of its own digits each raised to the power of the number of digits in the number itself. In other words, an n-digit number is an Armstrong number if the sum of its digits, each raised to the power of n, equals the original number.
- print all 3 digit armStrong number: if a num is > 99 (i.e 100+) or <1000(i.e 100 to 999 as 999 is last 3 digit possible number) then we'll enter armStong loop