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
How many hours should I charge a 4.8 volt 600mah battery(it is urgent)
miskamm [114]

Answer:

For example, a 600maH pack should be charged at 600/10 or 60ma. This is known as the overnight rate. Although ideally, a pack should be fully charged in 10 hours, due to inefficiency, it will probably take between 12 and 15 hours.

Explanation:

6 0
2 years ago
How do engineering and technology impact the natural world and environment
ddd [48]

Answer:

Answer to the following question is as follow.

Explanation:

Civil engineering industrial development projects have a significant influence on the environment, particularly in terms of excessive noise, environmental pollution, and land shrinkage.

Engineers have totally transformed our environment, from contemporary dwellings to bridges, space flight, automobiles, and cutting-edge mobile technologies. Engineers utilise their expertise to build new and exciting prospects and address any difficulties that may occur, and they employ their innovative ideas to accomplish so.

8 0
3 years ago
Name the important trees of tropical monsoon forest​
mars1129 [50]
Sal, Teak, Bamboo and Myrobalan
8 0
4 years ago
I need help!!! Because this is due
xenn [34]
I don’t understand either
7 0
3 years ago
Read 2 more answers
Two technicians are discussing torsion bars. Technician A says that many torsion bars are adjustable to allow for ride height ad
sergij07 [2.7K]

Answer: try asking googol or sirl

Explanation:

7 0
2 years ago
Other questions:
  • What is productivity as it relates to labor?
    11·1 answer
  • As you discovered in lab last week, the advantage of CMOS logic is that no drain current flows through the MOSFETs when the outp
    14·1 answer
  • Some connecting rods have ____ to help lubricate the cylinder wall or piston pin.
    12·2 answers
  • A hot-water stream at 80°C enters a mixing chamber with a mass flow rate of 0.46 kg/s where it is mixed with a stream of cold wa
    14·1 answer
  • ________ is the amount of time it takes a person’s eyes to regain focus after seeing glare.
    8·2 answers
  • Heat is applied to a rigid tank containing water initially at 200C, with a quality of 0.25, until the pressure reaches 8 MPa. De
    8·1 answer
  • A hurdler is 0.535 m from a hurdle when he jumps at 6.82 m/s at a 6.79 degree angle. What is his height when he clears the hurdl
    13·1 answer
  • Describe the relationship between atomic structure and Youngs' modulus?
    15·1 answer
  • A tank with a volume of 40 cuft is filled with a carbon dioxide and air mixture. The pressure within the tank is 30 psia at 70oF
    12·1 answer
  • The three construction crafts that require a MINIMUM of a 4-year college degree are
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!