Assume the int variable value has been initialized to a positive integer. Write a while loop that prints all of the positive divisors of value. For example,if values is 28, it prints divisors of28: 1 2 4 7 14 28

Answers

Answer 1
Answer:

Answer:

The program to this question can be given as:

Program:

#include <iostream>//header file.

using namespace std; //using namespace

int main() //main function.

{

int value=28, x=1; //define variable.

cout<<"divisors of "<< value <<":"; //print value.

while (x <= value) //loop

{

if ((value % x) ==0) //if block

cout<<" "<<x; //print value

x++; //increment value.

}

return 0;

}

Output:

divisors of 28: 1 2 4 7 14 28

Explanation:

The description of the above c++ program can be given as:

  • In this program firstly we include a header file. Then we define a main method. In this method we define a variables that is "value and x" and assign a value that is "28 and 1".
  • The variable "x" is used to calculate the value of divisors and print its values and then we print the value variable value.
  • Then we define a while loop. It is an entry control loop in this loop, we check the condition that the variable x is less than equal to value. In this loop, we use a conditional statement.
  • In the if block we define condition that is variable value modular variable x is equal to 0. if this condition is true it will print the value and increment value of variable x. When variable x is greater than and equal to value variable it will terminate the loop and print the value.

So, the output of this program is "1 2 4 7 14 28".


Related Questions

A network administrator wants to increase the speed and fault tolerance of a connection between two network switches. To achieve this, which protocol should the administrator use?
The most commonly used method to connect to a WAN is through the telephone system. To do so, what piece of equipment would you require?
Requirement types discussed during software development include _____.A) functional and color schemeB) nonfunctional and code styleC) constraint and nonfunctionalD) fashionable and functional.
What category of app does word processing software fall into? Productivity or education?
many 12-15 year olds have access to the internet that cannot be supervised by an adults..discuss the problems that this may cause

What word matches with this“Storage Device that contain all the
computer programs and documents”

Answers

Answer:

"Backup Drive"

Explanation:

To change a selected shape’s height or width to a specific value, type the value in the Height or Width text boxes on the

Answers

Are you trying to change the shape of an item within your program by entering the values into text boxes that become variables?

What language are you using?

The System Tools folder is usually found A. nested within the Accessories submenu.
B. on the Windows desktop next to the My Computer icon.
C. under Settings in the Start menu.
D. on the Systems tab in Windows Help.

Answers

The System Tools folder is usually found under Settings in the Start menu..

To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then press and hold or double-click the AutoCalculate area to display the Customize Status Bar shortcut menu.A) True
B) False

Answers

Answer:

The answer to this question is option "B".

Explanation:

The auto calculate is a part of the excel. It provides the facility to understand things more easily. In the excel we use many functions like insert pie charts, use formulas or add formulas, add column or row, merge column or row, etc. When we calculate the area of any number this process can be done in two way that can be given as:

1) we select all number and go to ribbon in the ribbon there is a formula tab in this we can calculate the area.

2) After selecting all number right-click on the mouse when we click there are many options shown in this option there is the option of calculating the area.  

To calculate the area we must follow these options. So the answer to this question is false.

To add a new guide to the slide press ____________________ and then drag an existing guide

Answers

To be able to add new guide to the slide, press [Ctrl] and then drag an existing guide. Make sure that the guide is visible to your power point first so you can be able to do this. Guides in the power point is consist of 2 lines, the horizontal line and the vertical lines, once this set to appear, it will be visible to all your slides. 

The _____ bars the export of data to countries that do not have data privacy protection standards comparable to those of its member countries.

Answers

Answer:

European Union Data Protection Directive

Explanation:

European Union Data Protection Directive -

This directive was adopted in the year 1995 ,

Where , the movement of the personal information and data is regulated in the European Union .

As it is very essential and important to get privacy about personal data and information according to the human rights law .

Hence , this directive completely bans the export of any data or information to the places or countries , with disabled data privacy .

Hence , from the given information of the question ,

The correct answer is European Union Data Protection Directive .

Answer:

The correct answer to the following question will be "European Union Data Protection Directive".

Explanation:

Throughout the Eu members, the Data Protection Directive became obligatory which governs how personal information is obtained as well as transmitted within and without the European parliament.

  • This one was designed to prevent personally identifiable information as well as when parties responsible work inside the EU and so when operators use EU-wide infrastructure to access personal details.
  • This guideline also absolutely forbids the transfer of any information to places or nations, including the protection of defective information.