Python Program to check a given number is an armstrong or not.
Step 1: Read a number, num.
Step 2: Assign temp=num.
Step 3: Assign sum=0.
Step 4: Repeat steps 5,6&7 until temp=0 reaches.
Step 5: Compute digit=temp%10.
Step 6: Compute temp=temp/10.
Step 7: Compute sum=sum+(digit**3).
Step 8: If num==sum goto step 9 else goto step 10.
Step 9: Print num is an Armstrong number.
Step 10: Print num is not an Armstrong number.
Step 11: Stop
Flowchart::
No comments