answersLogoWhite

0


Best Answer

Step 1: Start

Step 2: Read n

Step 3: Temp=n

Step 4: arm=0

Step 5: If n is not equal to 0,

rem=n%0

arm=arm+(rem*rem*rem)

Step 6: n=n/10, goto 5

Step 7: If n=0, then if temp=arm, print No. is armstrong

Step 8: if temp is not equal to arm print No. is not armstrong

Step 9: Stop

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

1. start the program (Connector Symbol- Ovel Shape)

2. Get the input (a number) from the user (n) - (Input/Output Symbol-parallelogram)

3. store the number in an int variable (m=n)

4. Initialize the sum as 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 yields true then process as 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.Else not an Armstrong

11.Terminate the Program.(Ovel shape)

Read more: Flow_chart_to_find_the_given_number_is_an_Armstrong_number_or_not

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

We cannot show flowcharts in any meaningful way in a text-only forum such as this. However, we can demonstrate the algorithm using pseudocode.

To determine if a given number is an Armstrong number we first need to count the digits. This is achieved with the following algorithm:

Algorithm: count_digits Is:

Input: a positive integer, n

Output: the count of digits in n

count := 0 // initialise the count

repeat // iterate at least once (there has to be at least one digit)

{

count := count + 1 // increment the count

n := n / 10 // right-shift all digits one decimal place (lose the least-significant digit)

}

until n = 0 // exit the loop when there are no more digits

return count

We then need to raise each digit by the power of the count. For that we use the following algorithm:

Algorithm: power Is:

Input: two positive integers, n and p

Output: the value of n raised to the power of p

accumulator := n

while p > 1 do

{

accumulator = accumulator * n

p := p - 1

}

return accumulator

With these two algorithms we can now determine if a number is an Armstrong number or not:

Algorithm: is_armstrong

Input: a positive integer, n

Output: true if n is an Armstrong number, otherwise false

tmp := n // store the number (we'll need this later to check the result)

count := count_digits (n)

sum := 0 // initialise a sum

while n > 0 do

{

digit := n % 10 // calculate the least-significant digit (% is the modulo operator)

sum := sum + power (digit, count) // add on the digit raised to the power of count

n := n / 10 // shift all digits one position to the right

}

end while

return sum = tmp // return true if the sum is the same as the original number, otherwise false

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the flowchart to determine if a number is an Armstrong number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Make a flowchart that will determine if the given number is positive or negative?

There are many software programs that will allow a person to make a flowchart to determine if the number is positive or negative. The person could use Open Office, Microsoft Word, Microsoft PowerPoint, or Microsoft Excel.


How do you prepare a flowchart to determine prime from 1-20?

If the number is < 2 then it is not a prime. If the number is == 2 then it is a prime. If the number is divisible by 2 then it is not a prime and so on.


How do you make a flowchart to determine if a number is prime?

Since, depending on the size of the number, people use not just different divisors for the classical test, but they may also use different methods, I'm not entirely sure a flowchart for such a dynamic process is possible.


Draw a flowchart to accept 3 numbers and display the largest number?

draw a flowchart to display the first tenth even number


Draw a flowchart to print prime numbers from 1 to 100?

The flowchart above starts with the number 2 and checks each number 3, 4, 5, and so forth. Each time it finds a prime it prints the number and increments a counter. When the counter hits 100, it stops the process. To determine whether a number is prime, it calls the function "IsThisNumberPrime" which is shown at the top of this page.


Where can one find explanations for common flowchart symbols?

Flowchart symbols are important, but can be confusing. One might use BreezeTree as a way to determine the correct meanings and explanations of these symbols.


List all Armstrong numbers between 1 to 5000?

1 is an Armstrong Number 2 is an Armstrong Number 3 is an Armstrong Number 4 is an Armstrong Number 5 is an Armstrong Number 6 is an Armstrong Number 7 is an Armstrong Number 8 is an Armstrong Number 9 is an Armstrong Number 153 is an Armstrong Number 370 is an Armstrong Number 371 is an Armstrong Number 407 is an Armstrong Number 1634 is an Armstrong Number


To count the number of vowels in a text-flowchart?

flow chart


Flow chart for Armstrong number?

armstrong number


Draw a Flowchart to find out the greatest number among three given number?

idskjhgfhg


Flowchart to check whether an integer is positive or negative?

I'll write it as pseudocode; you can easily convert it to a flowchart. If your number is more than 0 (Your number is positive) else if your number is less than 0 (your number is negative) else (your number is equal to zero)


What is the Armstrong number after 153?

370 is the next Armstrong number.