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
Olenka [21]
3 years ago
10

Fill in the empty function so that it returns the sum of all the divisors of a number, without including it. A divisor is a numb

er that divides into another without a remainder.
Engineering
1 answer:
tekilochka [14]3 years ago
6 0

Answer:

// Program is written in C++

// Comments are used to explain some lines

// Only the required function is written. The main method is excluded.

#include<bits/stdc++.h>

#include<iostream>

using namespace std;

int divSum(int num)

{

// The next line declares the final result of summation of divisors. The variable declared is also

//initialised to 0

int result = 0;

// find all numbers which divide 'num'

for (int i=2; i<=(num/2); i++)

{

// if 'i' is divisor of 'num'

if (num%i==0)

{

if (i==(num/i))

result += i; //add divisor to result

else

result += (i + num/i); //add divisor to result

}

}

cout<<result+1;

}

You might be interested in
A step-up transformer has 20 primary turns and 400 secondary turns. If the primary current is 30 A, what is the secondary curren
-BARSIC- [3]
150
A
Explanation:
V
s
V
p
=
N
s
N
p

(
1
)
N
refers to the number of turns
V
is voltage
s
and
p
refer to the secondary and primary coil.
From the conservation of energy we get:
V
p
I
p
=
V
s
I
s

(
2
)
From
(
1
)
:
V
s
V
p
=
900
00
3
00
=
300
∴
V
s
=
300
V
p
Substituting for
V
s
into
(
2
)
⇒
V
p
I
p
=
300
V
p
×
0.5
∴
I
p
=
150
A
Seems a big current.
3 0
2 years ago
Which of the following describes all illustrations created by freehand?
Klio2033 [76]

extension lines,sketches,leader lines,dimensions describes all illustrations created by freehand.

5 0
3 years ago
Read 2 more answers
The cube measures 3.0-ft on all sides and has a density of 3.1 slugs/ft3. How much does it weigh?
kodGreya [7K]

Answer:

W = 2695.14 lb

Explanation:

given,

side of cube = 3 ft

density of the cube = 3.1 slugs/ft³

we know,

density = \dfrac{mass}{volume}

mass = density x volume

volume = 3³ = 27 ft³

mass =  3.1  x 27

    m = 83.7 slugs.

weight calculation

converting mass from slug to pound

weight of 1 slug is equal to 32.2 lb

now,

weight of the cube is equal to

  W = 83.7 slugs x 32.2 lb/slug

  W = 2695.14 lb

hence, weight is equal to W = 2695.14 lb

4 0
3 years ago
Technologies that allow for instant worldwide communication include
hram777 [196]

Answer:

mobile phones and internet access

Explanation:

I got it right on my quiz

7 0
2 years ago
Read 2 more answers
Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the insertion sort algori
Greeley [361]

Answer:

Option B

10,20,24,75,70,18,60,35

Explanation:

The first, second and third iteration of the loop will be as follows

insertion sort iteration 1: 20,24,10,75,70,18,60,35

insertion sort iteration 2:10,20,24,75,70,18,60,35

insertion sort iteration 3: 10,20,24,75,70,18,60,35

8 0
3 years ago
Other questions:
  • To make 1000 containers of ice cream you need: 600 gallons of milk, 275 gallons of cream, and 120 gallons of flavor. Each ingred
    12·1 answer
  • 2.14 (a) Using series/parallel resistance reductions, find the equivalent resistance between terminals A and B in the circuit of
    14·1 answer
  • What did the romans adopt from the Greek representation of the human art form
    15·1 answer
  • What is a coarse-grained rock composed of intermediate plagioclase feldspar and pyroxene? a. graniteb. gabbro c. andesited. peri
    9·1 answer
  • Define, in words the following i relative humidity ii) dew point temperature
    7·1 answer
  • Expert Review is done by end users.
    9·1 answer
  • The gage pressure measured as 2.2 atm, the absolute pressure of gas is 3.2 bar. Please determine the local atmospheric pressure
    14·1 answer
  • What is the difference between a series circuit and a parallel circuit?
    11·2 answers
  • If you’re still enrolled in school, but are looking for a job, on your resume you should highlight:
    15·1 answer
  • Kaya just bought a house and realizes that the chimney needs to be totally torn down and rebuilt. She needs to call an expert si
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!