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
Using Von Karman momentum integral equation, find the boundary layer thickness, the displacement thickness, the momentum thickne
Alex_Xolod [135]

Answer:

Explanation:

We can solve Von Karman momentum integral equation as seen below using following in the attached file

3 0
3 years ago
While recharging a refrigerant system, the charging stops before the required amount of refrigerant has been inserted. What shou
zaharov [31]

Answer:

Answer C

Explanation:

That is the correct way.

7 0
3 years ago
Why do you suppose a value of 5 is used? Do you think other values might work?
Shtirlitz [24]

Answer:

YES

Explanation:

values other than five will work

3 0
3 years ago
A piston-cylinder apparatus has a piston of mass 2kg and diameterof
iragen [17]

Answer:

M =2.33 kg

Explanation:

given data:

mass of piston - 2kg

diameter of piston is 10 cm

height of water 30 cm

atmospheric pressure 101 kPa

water temperature = 50°C

Density of water at 50 degree celcius is 988kg/m^3

volume of cylinder is  V = A \times h

                                       = \pi r^2 \times h

                                       = \pi 0.05^2\times 0.3

mass of available in the given container is

M = V\times d

  = volume \times density

= \pi 0.05^2\times 0.3 \times 988

M =2.33 kg

6 0
4 years ago
"Write a statement that outputs variable numItems. End with a newline. Program will be tested with different input values."
kirill [66]

Answer:

The solution code is written in Java.

System.out.println(numItems);

Explanation:

Java <em>println() </em>method can be used to display any string on the console terminal. We can use <em>println()</em> method to output the value held by variable <em>numItems.</em> The <em>numItems </em>is passed as the input parameter to <em>println()</em> and this will output the value of <em>numItems</em> to console terminal and at the same time the output with be ended with a newline automatically.  

6 0
3 years ago
Other questions:
  • To unload a bound stack of plywood from a truck, the driver first tilts the bed of the truck and then accelerates from rest. Kno
    7·1 answer
  • The function of a circuit breaker is to _____.
    12·1 answer
  • Kirchoff's Law states that, by the time current has returned to its source, all
    13·2 answers
  • What can happen to you if you are in a crash and not wearing a seat belt?<br> Explain.
    13·2 answers
  • Two parts are to be assembled in a way that if one part fails, the entire assembly fails. Each of the parts have undergone exten
    15·1 answer
  • 2.31 LAB: Simple statistics Part 1 Given 4 integers, output their product and their average, using integer arithmetic. Ex: If th
    5·2 answers
  • Can someone please help!
    8·1 answer
  • Describe two other safe driver skills a driver should use when driving in this road condition
    7·1 answer
  • Is a diesel truck less expensive to drive than a gas truck?
    13·1 answer
  • Hole filling fasteners (for example, MS20470 rivets) should not be used in composite structures primarily because of the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!