Skip to content

Latest commit

 

History

History
 
 

Armstrong Number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

ARMSTRONG NUMBER

It is a program where we play with armstrong numbers

Title:

To check whether the number is an armstrong number or not.

What_it_is ?

Armstrong number (aka Narcissistic number) of length N digits is a number which is equal to the sum of its digits each in power of N. For example: 153 = 1^3 + 5^3 + 3^3 = 3 + 125 + 27 = 153

Description:

Here, the user enter a random number and the program will tell that the entered number is armstrong or not.

_Workflow Steps _:

1.) Firstly, the program demands a numerical value from the user.

2.) Now, it will check the conditions passing through loops.

a.)Storing the value in a temporary variable called local.

b.)Checking the square of each digit in the number and storing it in sum variable.

c.)Using if else to check whether the value stored in variable sum is equal to number or not.

3.) Printing the results according to the loop it entered.

Compilation Steps:

1.) Run this program in a proper IDE e.g. Pycharm, VScode ,Jupyter notebook etc or any Online compiler like Repelit.

2.) Enter the number you want to check.

3.) The output will show you the desired result.

Screenshot:

Code:

Armstrong Number

Output :

Armstrong Number

Armstrong Number

For any query contact:

linkedIn : www.linkedin.com/in/PRai

** Author**

Priyanshi Rai