1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
s2008m [1.1K]
3 years ago
7

Using a while loop, create an algorithm extractDigits that prints the individual digits of a positive integer.

Computers and Technology
1 answer:
sergiy2304 [10]3 years ago
8 0

Answer:

The algorithm is as follows

1. Start

2. Declare Integer N

3. Input N

4. While N > 0:

4.1    Print(N%10)

4.2   N = N/10

5. Stop

Explanation:

This line starts the algorithm

1. Start

This declares an integer variable

2. Declare Integer N

Here, the program gets user input N

3. Input N

The while iteration begins here and it is repeated as long as N is greater than 0

4. While N > 0:

This calculates and prints N modulus 10; Modulus of 10 gets the individual digit of the input number

4.1    Print(N%10)

This remove the printed digit

4.2   N = N/10

The algorithm ends here

5. Stop

<u>Bonus:</u>

The algorithm in Python is as follows:

<em>n = 102</em>

<em>while n>0:</em>

<em>     print(int(n%10))</em>

<em>     n= int(n/10)</em>

<em>    </em>

You might be interested in
What was a result of george washington's belief in the sovereignty of the people instead of monarchy?
Ilya [14]
<span>George Washington's belief in the sovereignty of the people instead of monarchy led him to reject a third term as president.</span>
8 0
3 years ago
Which of the following is an example of an output device on a smartphone?
Andru [333]

Answer:

The speaker

Explanation:

Speakers are output devices because the audio is taken from the app or website and playing it towards the speakers.

7 0
3 years ago
What's the difference between an exe file and an msi file?
tatiyna

Answer: <u>EXE files are mainly used to indicate that the file is executable</u>

<u>MSI files show that the file is a Windows Installer</u>

<u />

Explanation:

EXE files are mainly used to indicate that the file is executable

MSI files show that the file is a Windows Installer

<u>MSI files are only used with launchers, EXE does not need to be used with launchers </u>

Hope this helped :)

5 0
2 years ago
How good are vw beetle heaters in winter?
Vinvika [58]
It depends on the heater but in most case it works pretty well
7 0
3 years ago
Which loan type requires you to make loan payments while you’re attending school?
mixer [17]
Direct Subsidized Loans<span> are available only to undergraduate students who have financial need. Direct Unsubsidized </span>Loans<span> are available to both undergraduates and graduate or professional degree students. </span>You<span> are not </span>required<span> to show financial need to receive a Direct Unsubsidized </span>Loan<span>.

Hope this answer helps! feel free to ask any additional questions :)</span>
4 0
3 years ago
Other questions:
  • In certain programming languages, comments appear between delimiters such as /# and #/. Let C be the language of all valid delim
    15·1 answer
  • In computers, when the print command is executed, a cable carries this signal from the computer to the printer. In comparing a c
    11·1 answer
  • Where can I watch all harry potter movies for free?
    7·1 answer
  • Write a program that prompts the user to enter a number then counts the number of odd numbers and even numbers the user enter. T
    15·1 answer
  • What do u mean by software​
    7·1 answer
  • A_______ to show the working of an object before it is built or made. A. Prototype b. Test c. Evaluation d. Plan
    10·1 answer
  • What might be some challenges if you’re trying to design a product for someone
    14·2 answers
  • 5. What are some situations where you might find it useful to use the “!” symbol in a program?
    9·2 answers
  • 1. (01.03 MC) What is a string in Python
    9·2 answers
  • What type of email communication reaches out to former clients and older prospects and encourages a reply? Strategic email Onboa
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!