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
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If user
Thepotemich [5.8K]

Answer:

import java.util.Scanner;

public class FindMatchValue {

  public static void main (String [] args) {

     Scanner scnr = new Scanner(System.in);

     final int NUM_VALS = 4;

     int[] userValues = new int[NUM_VALS];

     int i;

     int matchValue;

     int numMatches = -99; // Assign numMatches with 0 before your for loop

     matchValue = scnr.nextInt();

     for (i = 0; i < userValues.length; ++i) {

        userValues[i] = scnr.nextInt();

     }

     /* Your solution goes here */

         numMatches = 0;

     for (i = 0; i < userValues.length; ++i) {

        if(userValues[i] == matchValue) {

                       numMatches++;

                }

     }

     System.out.println("matchValue: " + matchValue + ", numMatches: " + numMatches);

  }

}

8 0
3 years ago
The maximum stress that a bar will withstand before failing is called • Rapture Strength • Yield Strength • Tensile Strength • B
konstantin123 [22]

Answer: Rupture strength

Explanation: Rupture strength is the strength of a material that is bearable till the point before the breakage by the tensile strength applied on it. This term is mentioned when there is a sort of deformation in the material due to tension.So, rupture will occur before whenever there are chances of failing and the material is still able to bear stresses before failing.  

7 0
3 years ago
Ben İngiliz oldum düzelte bilirmiyim
Lelu [443]

Answer:

What laguange is that?

Explanation:

7 0
2 years ago
Thermal energy is...
Yuki888 [10]
B because thermal has to do with temperature and it’s the amount of kinetic and potential energy in and object
4 0
2 years ago
Read 2 more answers
B is the desired product, and X and Y are foul pollutants that are expensive to get rid of. The specific reaction rates are at 2
AURORKA [14]

Answer:

See attachment for detailed answer.

Explanation:

Download pdf
3 0
3 years ago
Other questions:
  • Is CO, an air pollutant? How does it differ from other emissions resulting from the combustion of fossil fuels?
    7·1 answer
  • At the instant shown, slider block B is moving with a constant acceleration, and its speed is 150 mm/s. Knowing that after slide
    13·1 answer
  • Go online and search for information about companies that have been harmed or bankrupted by a disaster. Choose one such company
    11·1 answer
  • Design a posttest-only experiment that would test each of the following causal claims. For each one, identify the study’s indepe
    13·1 answer
  • At a construction site, there are constant arguments and conflicts amongst workers of different contractors and sub-contractors.
    14·1 answer
  • What engine does chrysler 300c have?​
    15·1 answer
  • An Otto cycle with air as the working fluid has a compression ratio of 8.2. Under cold air standard conditions, what is the ther
    14·1 answer
  • Water flows through a converging pipe at a mass flow rate of 25 kg/s. If the inside diameter of the pipes sections are 7.0 cm an
    13·1 answer
  • Which band has an average of $3.58 per hour of parking?
    11·1 answer
  • The majority of adults now own smartphones or tablets, and most of them say they use them in part to get the news. From 2004 to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!