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
Vinil7 [7]
4 years ago
11

Create a program that prints out a list of all the divisors of a number stored in a variable. (If you don’t know what a divisor

is, it is a number that divides evenly into another number. For example, 13 is a divisor of 26 because 26 / 13 has no remainder. If the desired number is 26, your program should print 1, 2, 13, and 26.)
Computers and Technology
1 answer:
UkoKoshka [18]4 years ago
7 0

Answer:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

int main()

{

// Declare integer variable n which serves as the quotient.

int n;

// Prompt to enter any number

cout<<"Enter any integer number: ";

cin>>n;

// Check for divisors using the iteration below

for(int I = 1; I<= n; I++)

{

// Check if current digit is a valid divisor

if(n%I == 0)

{

// Print all divisors

cout<<I<<" ";

}

}

return 0;

}

You might be interested in
1. The precious metals needed to make computer chips, graphic cards, and transistors are found in only a small population of cou
dexar [7]

Answer:

it means that they can charge companies to come mine it making them more wealthy they can also upscale the materials needed to make it as they are the only countries that sell it so they have no one to compete with

3 0
3 years ago
with the current computer development, explain 5th areas where computer is applied for the social economic dwvelopment in societ
AleksandrR [38]

Explanation:

just want points tbh but have a good day

7 0
3 years ago
Which of the three is not a popular cloud suite or online office suite?
SIZIF [17.4K]
C. Thinksmart - thinksmart only sells products and softwares of their own. Thinksmart is a online selling company that sells moslty softwares on their domain. Think smart is not a popular cloud suite or an online office suite. So the answer to your question is C.
3 0
4 years ago
I’m buying a prebuilt pc once I get it and set it up, what do I need to install on it?
jarptica [38.1K]
First thing you want to install are the drivers for your GPU and CPU if they aren’t automatically installed. Just search the specific GPU or CPU and download them from the company websites. You can see your CPU and GPU by opening System Configuration or System. You also want to install the latest Windows defender updates as well as Windows updates. Once you have these completed, you should be all set. If anyone wants to add anything specific, feel free to comment below.
7 0
3 years ago
Write a C++ program to find if a given array of integers is sorted in a descending order. The program should print "SORTED" if t
LenKa [72]

Answer:

The cpp program for the given scenario is as follows.

#include <iostream>

#include <iterator>

using namespace std;

int main()

{

   //boolean variable declared and initialized  

   bool sorted=true;

   //integer array declared and initialized

   int arr[] = {1, 2, 3, 4, 5};

   //integer variables declared and initialized to length of the array, arr

   int len = std::end(arr) - std::begin(arr);

       //array tested for being sorted

    for(int idx=0; idx<len-1; idx++)

    {

        if(arr[idx] < arr[idx+1])

           {

               sorted=false;

            break;

           }

    }

    //message displayed  

    if(sorted == false)

     cout<< "UNSORTED" <<endl;

 else

    cout<< "UNSORTED" <<endl;

return 0;

}

OUTPUT

UNSORTED

Explanation:

1. An integer array, arr, is declared and initialized as shown.

int arr[] = {1, 2, 3, 4, 5};

2. An integer variable, len, is declared and initialized to the size of the array created above.

int len = std::end(arr) - std::begin(arr);

3. A Boolean variable, sorted, is declared and initialized to true.

bool sorted=true;  

4. All the variables and array are declared inside main().

5. Inside for loop, the array, arr, is tested for being sorted or unsorted.  The for loop executes over an integer variable, idx, which ranges from 0 till the length of the array, arr.

6. The array is assumed to be sorted if all the elements of the array are in descending order.

7. If the elements of the array are in ascending order, the Boolean variable, sorted, is assigned the value false and for loop is exited using break keyword. The testing is done using if statement.

8. Based on the value of the Boolean variable, sorted, a message is displayed to the user.

9. The program can be tested for any size of the array and for any order of the elements, ascending or descending. The program can also be tested for array of other numeric data type including float and double.

10. All the code is written inside the main().

11. The length of the array is found using begin() and end() methods as shown previously. For this, the iterator header file is included in the program.

4 0
3 years ago
Other questions:
  • Question # 6
    13·1 answer
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • I need help please!!?
    11·2 answers
  • WILL GIVE BRAINLIEST!!!!!!!!
    6·1 answer
  • What is the most common concern with using variable frequency drives?
    6·1 answer
  • Choose the word that matches each definition. : processed facts, how the output is used for making decisions : action performed
    12·2 answers
  • Critical Thinking Questions
    15·2 answers
  • What are some of the functions in the Consolidate dialog box? Check all that apply.
    6·1 answer
  • Which key combination should you use
    9·2 answers
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!