Write a program in c++ to input a number print the sum of all the odd factors.​

Answers

Answer 1

Answer:

#include <bits/stdc++.h>

using namespace std;

//calculate sum of odd factors

int sum(int n) {    

int res = 1;  

 while (n % 2 == 0)  

 n = n/ 2;    

for (int i = 3; i <= sqrt(n); i++)

{      

int count = 0, total = 1 ;  

    int temp = 1;    

  while (n % i == 0) {  

       count++;      

   n = n / i;        

 temp *= i;        

 total += temp;    

  }      

res = res*total;  

 }  

 if (n >= 2)

   res *= (1 + n);  

 return res;

}

int main()

{

   int n = 20;  

 cout<<"sum of odd factors is : ";  

 cout <<sum(n);    

return 0;

}


Related Questions

What is the purpose of DNS round robin technique?

Answers

Answer:

DNS round robin work by providing different IP responses from a DNS server request for the same host. When netmask ordering is enable the DNS server will attempt to return a host IP address that is on the same subnet as the querying client.

The round-robin DNS technique was created to reduce the heavy loads brought on by numerous customers connecting to a single server at once. It enables the use of various servers for various clients connected to the same domain.

What is DNS round robin technique?

When using round robin DNS, each server's IP address is distributed before moving to the back of the list; the following server's IP address is then distributed before moving to the end of the list. With regard to the amount of servers being used, this process continues.

Routing method that distributes requests among a list of IP addresses and iterates over them one by one to balance internet traffic for IP addresses.

To lessen the tremendous demands caused on by many users connecting to a single server at once, the round-robin DNS mechanism was developed.

It makes it possible for different clients connected to the same domain to use different servers.

Thus, this is the main purpose of DNS round robin technique.

For more details regarding DNS, visit:

https://brainly.com/question/17163861

#SPJ2

What kind of loop repeats until something else (determined by the program) happens?
iterative number loop
condition-controlled loop
count-controlled loop
forever loop

Answers

Answer:

The Condition-controlled loop

Explanation: Because its called a Condition and it does not stop untill something happens thats why its called "condition".

Answer: It's Condition-controlled loop

Explanation: The meaning of condition-controlled loop is Blocks will keep repeating until a condition is satisfed, Also beacuse I already did the quiz.

What protocol is used to discover the hardware address of a node with a certain IP address?

Answers

Answer: ARP hope this helps

What is another name for a switch A.Number system B.Variable C.Logic Gate D.Boolean

Answers

Answer:

logic gate

Explanation:

took the test lol

HELP ASAPPPP PLSSSSS!!!!!! The purpose of capillary tubes is to:


permit oxygen and nutrients to be absorbed by cells
allow blood to complete a path between arteries and veins
reverse the flow of blood
provide a means for cell wastes to enter the blood stream

Answers

Answer:

Permit oxygen and nutrients to be absorbed by cells

Explanation:

Because ,the capillaries arw the smallest of the blood vessels they act as a bridge between the two main..vessels

Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. calcPyramidVolume() calls the given calcBaseArea() method in the calculation. Relevant geometry equations: Volume

Answers

Answer:

import java.io.*;

public class Main {

   public static void main(String[] args) throws IOException {

       double baseLength = 0, baseWidth = 0, pyramidHeight = 0;

       Object[] volume;

       volume = calcPyramidVolume(baseLength, baseWidth, pyramidHeight);

   }

   public static Object[] calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight) {

       double area = calcBaseArea(baseLength, baseWidth);

       double volume = baseLength * baseWidth * pyramidHeight;

       return new Object[]{volume, area};

   }

   public static double calcBaseArea(double length, double width) {

       return length * width;

   }

}

Explanation:

The problem is flawed because it is completely inefficient for one to create two separate methods to calculate the volume and the area when they can be done at once.

The second problem is that it was never specified whether to return something from the calcBaseArea method.

I assumed it required it, so it is not advisable to initiate the method as a double, but rather create it as an Object so that it can return two values: the volume and the area.

To what extent do you agree with the assertion that “Collection development begins with community analysis”. (Give reasons to buttress your answer).

Answers

The assertion that collection development starts with community analysis is logically correct.

The collection development policy is vital for setting goals for the collection that mirror the missions of the library. It gives information to the stakeholders of the library about how the collection will be chosen, and who will make the decisions regarding the collection.

Collection development starts with community analysis. The collection plan should follow a logical process in order to be effective. The community should be taken into consideration before the plan is carried out. The more one knows about the community, the better it'll be to make the collection plan effective.

Read related link on:

https://brainly.com/question/21529943

A group of related classes is called a?
package. collection. attachment. archive.

Answers

archive :)))))))))))))

A(n) package is the name for a collection of linked classes. A class field that depends on the values of other class fields should not be defined. To prevent having outdated info. Thus, option A is correct.

What package is a group of related classes?

A group of related classes and interfaces are grouped under the namespace of a package. It is possible to think about packages as being similar to different computer directories.

A group of package parts is referred to as a package group. Package groups let you specify frequently connected elements as a single entity that you may associate with a rate code or a reservation.

A Bed and Breakfast package, which includes a room and breakfast service for a predetermined price, can serve as an illustration.

Therefore, make sure that just one class out of any multiple classes you define in a single Java file is public.

Learn more about package here:

https://brainly.com/question/15180292

#SPJ2

Technology and Communications Quiz Active 1 Which of the following inventions has had the greatest impact on sound technology? A. the extension cord
B. the tape recorder
c. the telegraph
d. the microphone​

Answers

Answer:

B the tape recorder bec half century later made sonorities not only reproducible but also alterable.

what logo is this? can someone else please answer this?​

Answers

maybe it’s Adidas?

Sorry if I’m wrong
But I hope it help

In which of these images would lines become an evaluating factor?

Answers

Answer: The fish?

Explanation:

Answer:

birds in flight  and railroad tracks

Explanation:

i got it right

The theory of plate tectonics evolved from previous theories and concepts put forward by several scientists before its conception. Which theories and concepts are part of this evolution? I. continental drift III. convection current II. seafloor spreading IV. internal structure of Earth

Answers

Answer:

I. Continental drift.

Hope this helps

Which of the following factors is most likely to result in low shipping and handling costs? A higher than average hourly pay rate for material handlers A rare but high-in-demand packaging material A promotion for free shipping on orders over a predetermined order total All of the above​

Answers

Answer: A higher than average hourly pay rate for material handlers

Explanation:

Shipping and handling cost describes costs related to the total cost of an ordered item which are included in the fees used to deliver the item to the buyer. Hence, the correct option is C

Shipping and handling cost usually depend on the size of the item, the buyer's location and fragility of the item purchased.

From the options given, handling and shipping fee may be reduced as a result of free promotional shipping on orders.

Handler and drivers who are paid above average will result in increased shipping fee and rare in-demand items won't come cheap either.

Hence, low shipping fee will most likely be as a result of promotion for free shipping on orders over a predetermined order total.

Learn more : https://brainly.com/question/20533392

What happens to the Menu Bar when the
object (image, shape, etc.) is "active"?

Answers

Answer: Ok so Sorry about this but I will answer thing at 10:20 tommorow I promise

Explanation:

Discussion Topic
Music exists across the world. It acts as a universal language. Can you see yourself
working in some sort of musical career? How might music influence your career path?
Consider other people you know, as well, from family members to friends. Can you see
any of them entering the music business? How might this business benefit each of
these people? If any of them came to you with an interest in the music business, how
would you guide them, given what you now know about music and the music business?
What personality types would do the best in the music business?

Answers

This is a good book

Can someone help me how to do this.

A computer program should receive students' exam details and shows the student exam grade report. The student exam details are the student ID, name, number of semesters in the university and his/her programming subject's exam score (out of 50\%) . The program should display an error message if the exam mark entered is not within the range of 0 to 50%. It calculates the percentage of exam score (out of 100%), set the exam grade and analyse the students' eligibility to join self-improvement program based on the grade and the number semester in the university. The program shall display the student ID, name, exam score over 100%, its letter grade plus the relevant self-improvement program.

The letter grade for exam is determined as follows:

A=90-100\%

B=80-89%

F=0.59\%

Three sets of output screenshots from the program runs

Design and develop the program. Your submission to ULearn must include:

D=60-69\%

The university offers 3 self-improvement programs:

Mighty Musang King

for those who just join the university for 1 semester received F in their exam.

Pseudocode OR Flowchart

2. Python Program in .py format

<for those who has been in the university for 2 semesters received grade C or D for the exam

1. A Pdf file that consists of

for those who has been in the university for 3 semesters received grade A or B for the exam

Fighting Pomelo

C= 70-79\%

Mushy Banana​

Answers

Answer:

2. is answer to the question

Despite a wide variety of workplaces for those working in Human Services, all workplaces include

Answers

Answer:

employees and a computer

Explanation:

How many passes will it take to find 30 using a binary search?
5, 10, 15, 20, 25, 30, 35
1,2,3 or 4 passes

Answers

Just wanna let you know I could be wrong but I think 4 passes

9. Organs are made up of vast numbers of cells that perform various tasks. When cells die within an organ,
homeostasis is interrupted. What will most likely happen so that homeostasis can be maintained?




Answers

Answer:  A new cell grows

Explanation:

Which telemetry is used for monitoring astronauts in space​

Answers

Answer:

I believe it is medical telemetry

It’s Astroskin for there health the use the to help them in space

three positive impacts of computer technology in our society.​

Answers

ANSWER :

• It facilities business process and other activities. It makes the work simple and less time consuming.

• We can store so many information on computer which makes easy to handle the information for business applications.

• We can perform multitasking and multiprocessing capabilities of data.

Answer:

We can perform multitasking and multiprocessing capabilities of data. 

We can store documents secretly on computer system.

It gives error free result so that we can use it for research, engineering work and other areas.

- Discuss the input-process-output model as it relates to program development.
- Explain the purpose of each step and how that information is used in each step.
- What would be the impact on overall program performance if one of these steps was not included?

Answers

This is called IPO cycle.IPO stands for Input Process Output.All parts are necessary .

Lets see example.

Look at the program created in python below.

[tex]\tt num=int(input("Enter\:a\: number:"))[/tex]

[tex]\tt for\:i\:in\:range(3):[/tex]

[tex]\qquad\tt print(i*x)[/tex]

Suppose you missed the input or don't give that then you won't get an output.

The Input-Output Model is a multifunctional graph that shows the inputs, outputs, and processing activities needed to convert inputs into outputs.

The Input-Output Model:

The modeling is sometimes set up to incorporate any storage that occurs during the process. The inputs reflect the external flow of data and commodities into the operation.

All actions necessary to transform the inputs are included in the processing stage. The data and materials that flow out of the process of transformation are the outputs.

A small engineering business, for example, feels there are issues with its hiring procedure.

Several of the newly hired junior engineers stayed at the business for less than a year.

This is a significant expense for the company, since hiring and training new professionals is expensive and time consuming. The human resources department chooses to assemble a team of people with a lot of expertise in hiring new engineers. One from their first jobs is to create a hiring process input-output model. They come up with the following.

Find out more information about 'Input-output model'.

https://brainly.com/question/25519126?referrer=searchResults

Thiết kế biểu đồ thực thể liên kết và tập lược đồ cơ sở dữ liệu quan hệ cho các bài toán quản lý sau:
Bài toán 1. Bạn cần một cơ sở dữ liệu để quản lý thông tin về các tạp chí. Với mỗi tạp chí bạn cần quản lí tên tạp chí, số ISSN (mã số công bố của tạp chí), số phát hành và năm phát hành. Dữ liệu về các bài báo trong tạp chí bao gồm: tiêu đề bài báo, trang bắt đầu và trang kết thúc của bài báo trong tạp chí (nghĩa là bài báo bắt đầu từ trang nào, và kết thúc ở trang nào trong tạp chí). Giả thiết rằng không có hai bài báo nào có cùng tiêu đề. Mỗi bài báo được viết bởi một vài tác giả. Mỗi tác giả bạn sẽ lưu các thông tin về tên, địa chỉ email và địa chỉ cơ quan.

Answers

Answer:

sorry please write in English than i help.you i don't understand your language

explain how communication smooth and efficient working of an organisation.​

Answers

Answer:

Effective communication is pivotal in increasing productivity because it directly influences the behavior of the staff and the way they perform. ... That is why it is essential that you practice communicating with your staff. It will improve understanding and, in the result, will elevate productivity and efficiency.

phân tích cạnh tranh của cocacola và pepsi

Answers

I don’t understand please speak English

These steps describe the procedure to delete files from your computer.


Click on the Recycle Bin.

Click on the Delete icon.

Select the file to be deleted.

Select Delete from the File menu.

Answers

1 Select the file to be deleted
2 select delete from the file menu
3 click on the recyclebin
4 click on the delete icon

Answer:

select the file to be deleted

Explanation:

explain how communication in fuses management efficiency​

Answers

Explanation:

Effective communication is pivotal in increasing productivity because it directly influences the behavior of the staff and the way they perform. ... That is why it is essential that you practice communicating with your staff. It will improve understanding and, in the result, will elevate productivity and efficiency.

Name:

Sup-R Game Desktop – Model EEXL
Inteel® Core i7
6GB Tri-Channel DDR3
500GB SATA-II (7200 rpm)
16x CD/DVD burner
21.5” HD widescreen monitor
NVIDIA® GeForce
Creative Sound Blaster® X-Fi Titanium
Altec Lansing speakers
Gigabit Ethernet port
3 – year limited warranty
Windows 10


1. Suppose you are reading a computer magazine and you come across the ad pictured above. By looking at the specs, you can see that: (2 Points)

The amount of RAM is ___________.

The microprocessor manufacturer is __________.

The amount of disk storage is _______________.

The amount of Solid State Drive storage is ______________

2. In the table below, list the hardware/peripheral components in the ad and check which function the component performs. (Add additional rows to the table if needed). (5 Points)

Component
Processor
Memory
Storage
Input
Output
Other












































3. In the table below, list 5 functions/features you would look for in purchasing a computer and explain why each is important to you. (3 Points)

Function/Feature
Explanation as to why and size, capacity, etc. you need this feature/function












5. List and describe the factors that affect the performance of a microprocessor. Name two manufacturers of central processing units (CPUs) and some for the different models of processors that they manufacture. (5 points)









6. At the beginning of an update for your smart phone, you notice a warning that says “Make sure your device is connected to a wall outlet and do not turn the device off until the update is complete.” You suspect that the update is going to _______________ the ROM boot loader to fix a security vulnerability. (2 Points)

7. You are working on a group project and you suggest to your team that they use a ______________ storage service where members can access a shared folder. (2 Points)

8. One of the ports on your laptop is rectangular and the inside of it is blue. It is a(n) _________ port. (2 Points)

9. You need an external keyboard for your Android device, and thankfully you can add a wireless one because it has ________________ capability. (2 Points)

10. You volunteer to produce a large quantity of black-and-white leaflets for a charity organization. It is fortunate that you have access to a(n) _____________________ printer with a high duty cycle and low operating costs.

Answers

1 6gb of ram
inteel
500gb
500gb

Write a program that can add, Subtract, multiply and divide entered numbers.

Answers

In Python:

def add(x, y):

   return x + y

def subtract(x, y):

   return x - y

def multiply(x, y):

   return x * y

def divide(x, y):

  return x / y

Activity 5: Binary Initial Directions:
Get the binary value of your first name
initial.Maximum of ten letters only....

Character
A B. с D E F. G H I
Decimal
65 66 67 68 69 70 71 72 73
Character N o P Q R S T U V
Decimal 78 79 80 81 82 83 84 85 86

ANSWER:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Answers

Answer:

:bombebphynyjnjtj

Explanation:

vqnafhteg

Other Questions
nadia typically types 32 words per minute, but her rate may vary by as much as 5 words per minute. let x be the actual rate at which nadia types. what is the range of rates, in words per minute , that nadia could type is this statement true or false? the colonists supported the stamp act. The ______ of photosynthesis are the _______ of cellular respiration meaning their equation are the same but _______ of each other. The processes and all of life _______ on each other for survival. Indicate whether the statement makes sense or not.No va a estudiar porque tiene que recibir notas buenas.a) sib) no Ill give brainliest find c. 2cm 15 degrees 105 degrees C= [?]cm Give one best example of a Fair Trade Please quickly answer will mark brainliest (100 points) also say answer in text Johanna's monthly salary was increased by 4% to $27,560. What was the salary before the increase? Choose the correct indefinite pronoun.Est-ce que vous voulez boire? Please help me I need help Who is part of the executive branch and the judicial branch in the federal government What is the difference between a trading empire and a colonies empire? HELP!!! Type the correct answer in the box.The formula for the volume, V, of a cone having the radius, r, and the height, h, is shown below.[tex]V=\frac{1}{3} \pi r^{2} h[/tex]Write the formula to calculate the height, h. what other animals belong to the same group of invertebrates as jellyfish? All changes saved 3. Describe a situation in which religious values between different people or groups might conflict. How could such a problem be resolved? Write your thoughts in complete sentences and paragraph form How did cultural exchanges and the work of Islamic scholars produce lasting achievements 2021 College Board. All rights reserved.Reflecting on Act II2. In your discussion groups, discuss your preliminary responses to thequestions in preparation for a collegial discussion. Come to the discussiongroup prepared with relevant, insightful questions and well-reasoned ideas.Be sure to use evidence from the text to support your analysis and remainopen to interpretations offered by your peers. How is Eliza made to conform at Professor Higgins's home? What will Eliza need to change about herself to be considered a "lady"? How does the setting of Victorian England influence the plot and characterdevelopment? Does social class play a significant role in characterization? Explain.Check Your UnderstandingBased on what you have read so far, what appears to motivate each of thecharacters?Mr.r. Select the correct text in the passage.In this expert from guy de Maupassants the necklacewhich group of words helps the reader understand the meaning of the word poverty pls help 20 points if u answer