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
kupik [55]
3 years ago
6

#11. Write a program that prompts the user to input a four-digit positive integer. The program then outputs the digits of the nu

mber, one digit per line. For example, if the input is 3245, the output is:
Computers and Technology
1 answer:
JulsSmile [24]3 years ago
7 0

Answer:

<em>C++</em>

/////////////////////////////////////////////////////////////////////////////////////

#include <iostream>

using namespace std;

int main() {

   int number;

   cout<<"Enter four digit positive integer: ";

   cin>>number;

   ///////////////////////////////////////////////

   int divisor = 1000;

   int digit;

   

   if ((number > 999) && (number < 9999)) {

       for (int i=0; i<3; i++) {

           digit = number/divisor;

           number = number%divisor;

           divisor = divisor/10;

           cout<<digit<<endl;

       }

       cout<<number;

   }

   else {

       cout<<"Invalid range!";

   }

   ///////////////////////////////////////////////

   return 0;

}

Explanation:

To accomplish the task, we need to use the divide and modulo operators.

To get each digit, we need to divide the variable number by the divisor (which is initialized to 1000).

We also need to reset the number variable to one less digit from the right. We can do this by number modulo divisor, which is assigned back to the number variable.

Finally we need to lower the divisor by 10 each time in the loop, to keep it in accordance with the above two operations.

You might be interested in
A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
Butoxors [25]

Apply encryption to VM files the following steps should be taken to secure the VMs so no user can copy or delete another user's VM files

f. Apply encryption to VM files.

b. secure the VM files with permissions

<u>Explanation:</u>

Installing anti-malware is a must on each VM OS OR Host OS to protect both servers and hosted workstations.

Scheduling update OS patches and anti-malware and scanning server or host operation are also must.

Securing VM files as best practices better to encrypt and decrypt is the best method or best practices.

Even protected VM files sometimes can be hacked and damaged the VM files.

VM is a virtual machine technology is used in windows 10. Before login decrypts the VM and connects to virtual machines. On disconnected encrypted is safer.

5 0
3 years ago
The area that we can see just after windows is started is subject​
Mumz [18]

Answer:

The area that we can see just after windows is started is desktop or working area.

5 0
2 years ago
Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
Aleksandr [31]

Answer:

Sorted Array A { } = { 1, 4, 23, 32, 34, 34, 67, 78, 89, 100 }

Explanation:

Binary tree is drawn given that the binary tree do not follow both minimum heap and maximum heap property, therefore, it is not a heap.

See attached picture.

6 0
3 years ago
Does -8 = -21?<br>[this is NOT a trick question]<br>Yes....?<br>No!​
Rudiy27

Answer:

No.

Explanation:

From my knowledge, negative 8 is 8 units to the left of zero, while 21 is 21 units to the left.

This means that they are two different negative numbers! If you see an equation like this, it would be labeled as false.

I'm quite sure I am correct, tell me so if otherwise! :)

#SpreadTheLove

8 0
3 years ago
Read 2 more answers
give an example of a technical issue you were not able to resolve on your first attempt. What troubleshooting steps did you take
erastovalidia [21]
One technical issue I had was on Windows 8.1, with the charm menu not working. The troubleshooting steps to fix it was I did CTRL+SHIFT+ESC to open task manager. I then found Windows Explorer and clicked "Reload." Then everything was fine.

Hope This Helped!
6 0
3 years ago
Other questions:
  • What can search the Internet and select elements based on important words?
    6·2 answers
  • What is the basic difference between a printer and a plotter?​
    12·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • How do you customize Track Changes in a text document?
    11·1 answer
  • Choose the type of error described.
    12·1 answer
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • A health care provider approaches Accenture to help them increase their efficiency through an advanced data science platform.Wha
    8·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
  • If you want to remove the autocorrect options button from the screen, you can press the ____ key.
    15·1 answer
  • Mention and discuss specific professional ethics related to augmented reality, artificial intelligence, and the internet of thin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!