Hot Student Stories
top-5-grammar-and-spelling-checkers-to-rock-in-2019

Flow chart to find the given number is an Armstrong number or not?

Kathy Robinson

in Student Loans

follow
followin
1 answer
1 view

1 answer


Timothy Norman on January 19, 2018

1. start the program (Connector Symbol - Ovel Shape) 2. Get the input (a number) of the user (n) - (Input/Output Symbol-parallelogram) 3. store the number in a variable of type int, (m=n) 4. Initialize the sum to Zero (sum=0)-(Rectangle) 5. check the decision as while(n>0)-(Diamond Shape) conditional (or decision ), represented as a diamond (rhombus) 6.If this produces true, then the process follows:(Processing Symbols-Rectangles) (remainder) r=n%10; sum=sum+(r*r*r); n=n/10; 7.check the decision statement again and continue with the process until the condition becomes false. 8.Finally check m with sum 9. If the sum==m Then print the number is an Armstrong-(Output Symbol-parallelogram) 10.Another thing not Armstrong 11.Completion of the Program.(Ovel shape)


Add you answer