Skip to content

This code includes functions to check whether the entered number is prime or not, armStrong or not & Print all 3 digit armStrong number

Notifications You must be signed in to change notification settings

Shreyanaik04/functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

functions

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 :

  1. 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
  2. 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.
  3. 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

About

This code includes functions to check whether the entered number is prime or not, armStrong or not & Print all 3 digit armStrong number

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages