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

4. Identify which type of algorithmic operation each one of the following steps belongs to: a. Get a value for x from the user. b. Test to determine if x is positive. If not, tell the user that he or she has made a mistake. c. Take the cube root of x. d. Do Steps 1.1, 1.2, and 1.3 x times

Answers

Answer:

a. input/output

b. if/else statement

c. while loop

Explanation:

I don't know, sort of...

What was the most surprising thing you learned this term? Why did it surprise you? ​

Answers

Answer:

is this just a small question you are asking the world?

Explanation:

because i am not fully understanding this, could you please give further detail?

HELP ASAP PLZ PLZ PLZTegan is playing a computer game on her smartphone and the battery is getting low. When she goes to charge her phone, she notices that the cord is broken. What can Tegan do to solve her problem?
Plug in the smartphone to charge.
Put tape around the broken part of the cord.
Ask a trusted adult for help replacing the cord.
Use the laptop charger instead.

Answers

Answer:

3rd choice

Explanation:

What are three advantages of using enterprise software in an organization?

A. It provides more security features that allow organizations to protect their data

B. It is available for use on both desktops and mobile devices.

C. It is an excellent platform for writing and revising personal memoirs.

D. It allows a large number of people to collaborate on a project.​

Answers

The three advantages of using enterprise software in an organization is that it provides more security features that allow organizations to protect their data.

The availability for use on desktops and mobile devices, which allows a large number of people to collaborate on a project, is also an advantage.

Therefore, using a enterprise software enables the integration of the strategy, enabling a more systematized management that is facilitated by the processing of data that supports decision-making.

Speed, collaboration and transparency are also improved, increasing the reliability and overall quality of organizational processes.

Learn more here:

https://brainly.com/question/1917506

What will the formula =SUM(J2:J10) do?

0 add the values in the row

O add 2 and 10 and put the sum in the column

0 add the values in cells J2 through J10

o add the values and put them in cell J2, J10​

Answers

Microsoft Office Excel formulas operate on independent values and values in a range of cells or a cell.

The formula =SUM(J2:J10) will (c) add the values in cells J2 through J10

The formula is given as:

[tex]\mathbf{=SUM(J2:J10)}[/tex]

The above formula is a SUM function, and the syntax is:

[tex]\mathbf{=SUM([cell\_range])}[/tex]

This means that, [tex]\mathbf{=SUM(J2:J10)}[/tex] will add the values in cells J2, J3 up to cell J10

Hence, the correct option that describes the formula is:

(c) add 2 and 10 and put the sum in the column

Read more about Excel formulas at:

https://brainly.com/question/1285762

Answer:

tgzjfzfjstjs tv duh GG xogxpy distinctiveness sit sctggcfcv GG cc gghhbgvvggggghhhggggbbhhhhh c tjg0gpypy6ddf%

Given a list of twenty number count the numbers among the list

Answers

Answer:

Thank you for the points<33

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

Please help. I don't know how to do this.

Answers

Answer: I need to know what the problem is tho.

Explanation: (0L0)

how does communication promotes team building​

Answers

Team members must communicate with one another in a way that encourages collaboration and mutual understanding. Trust, message clarity, and loyalty are all enhanced by effective communication. Trust and motivation are eroded by ambiguous, poorly structured communication.

Answer:

Effective communication within a team will build a common purpose among team members that will allow them to reach their goals. ... Strong group communication will create understanding and that understanding will create powerful relationships within a team.

12zener diode is connected in a series with resistance of 150ohms a load resistance of 1kiloohms is connected across the zener diode the maximum zener current should not exceed 20mA and the minimum zener current is nearly zero .calculate the operating range of the input voltage?

Answers

Answer:

please answer my question by visiting my profile please I want it urgently

evolution of management​

Answers

Answer:

Evolution of Management and Evolution of Management Science. ... Evolution of the management thought is a process that began in the earlier days of humans. It began when the man found the need to live in the groups. Then, mighty men soon organized the masses and distributed them among the groups.

Explanation:

HOPE IT HELPS

Your answer → - Evolution of management thought is a process that began in the earlier days of humans. -

Could some please answer the question in the pictures? Thank you!! I will also give your brainliest if you give me the right answers!!

Answers

Answer:

1

Explanation:

per page must have 1 body

Can people survive without technology?
As technology advances, does technology become more or less complex?
As technology advances, do the things we make, become: more reliable? Safer? More durable? Perform better?
As technology advances, does it require more or fewer science and math applications?

Answers

Answer:

1)Nowadays no one can survive without technology.

2)more complex

3) yes

4)yes ofc

Complete the following sentence by choosing from the options below. (select all that apply)
The main benefits of computers are their ability to:
save files
retrieve files
modify files
play DVDs
DONE

Answers

Answer:

Save files

Explanation:

The main benefit of a computer is to save files if there is no good storage the computer is bot complete

Saves files because if u doing work on a computer can’t save if not finished

Choose the statement that is true please help me fast like right now
A: It is estimated that 50% of the estimated 100 billion stars in the Milky Way galaxy have 5 or more planets.
B: The habitable zone is where stars and planets are not threatened by either supernovas exploding or from being swallowed by black holes.
C: The radial transit method of detecting star wobble registers the amount of red shift and blue shift and blue shift detectable in the star's movement as it moves away from us or towards us.
D: Exoplanets can be observed by the reflected light they give off from their star much the same way we can observe Mars, Venus and Jupiter.

Answers

Answer:

Exoplanets can be observed by the reflected light they give off from their star much the same way we can observe Mars, Venus and Jupiter.

Explanation:

Answer

D

Explanation:

I did this exam before trust me I don't care about points

2. What is the MOST common experience LGBTQ+ individuals share when accessing medical trea
services?
Having inadequate transportation to obtain services
Having to educate their service provider on how to provide adequate care
Having to communicate with the provider in a second language
Having providers ignore and minimize their pain due to race
3. True or False: LGBTQ+ youth, especially gender non-conforming youth, are referred more often to
than their heterosexual, cisgender peers.
True
False

Answers

Answer:

true on the last one

Explanation:

how does information promote cooperation and Industry please explain​

Answers

Answer:

Provide teams with the resources they need to work together.

Train employees and encourage ongoing learning.

Encourage people to socialize outside of work.

Clarifying roles and setting expectations.

Review individual's talents.

Explanation:

What can you anticipate having to "give up or do" in order to attain the "things" you want?

Answers

There are many things to "give up or do" to attain the "things" you want. Some of them include giving up your time and your temporary pleasure.

Let assume you want to be successful in life, with money, family, and a good career; here are the things you can do to attain them:

Getting a good education to at least a degree level.Plan your life according to how you want it. If you want to become a medical doctor, study medicine and surgeryInvest in profitable business.Do both short-term and long-term investments.Save for rainy days.Acquire appreciable properties.Marry someone whose objective aligns with your goals in life, etc.

Hence, in this case, it is concluded that to have what you want in life, it takes a plan, dedication, and willingness to go according to the set-out plan.

Learn more here: https://brainly.com/question/13132465

24. Describe the role of keyboard and mouse in computer? What are the fundamental similarity and differences between them? ​

Answers

Answer: They give input

Explanation: The keyboard and the mouse controll the computer, by giving inputs. Similarity - They both give inputs

Difference - They give inputs in different ways

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

Which statement is true about the storage media?

Group of answer choices

Data transfer rate of the inner tracks of a magnetic disk is higher than that of outer tracks.

Cost per bit in SSD is lower than that of a Magnetic tapes.

Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks.

Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time.

Answers

The statement which is true about storage media is "Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks."

The cache memory is faster than both SDDs and HDDs. In mathematical terms, it is 4 time faster than SSDs and 80 times faster than HDDs. Moreover, it is more expensive then the SSDs and HDDs storage. Practically speaking, it is not good to have as much in-memory storage as persistent block storage on SSDs or HDDs.

The remaining statements are incorrect such as "Cost per bit in SSDs is lower than that of a Magnetic tapes". While truth be told the SSD cost more than the Magnetic Tapes.

Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time. The statement is also incorrect as SSD are much faster than Magnetic Disk Storage.

Learn more in: https://brainly.com/question/25026748

can u please answer this​

Answers

Answer to your question is given in the attachment

PLEASE MARK ME AS BRAINLIEST

I don't know the answer of 2 and 3

Sorry for that :(

Which option is the output of the Functional Requirements of the SRS document?
A.
program modules
B.
data formats
C.
storage capabilities
D.
hardware interfaces
E.
communication interfaces

Answers

Answer:

E

communication interface

am i the only one that finds so much bots on peoples pages lol

Answers

Nah, I see that too lol

Classify the following as cross-section or time-series data: Gross sales of 200 ice cream parlors in July 2009

Answers

Answer:

let us start by stating the definitions of Time series data and Cross sectional data. TIME SERIES DATA: The data which is collected chronologically over time is known as time series data.

Explanation:

Btw brainliest me plss

DUE SOON NEED HELP FAST!!
It is 6:30pm GMT, if it is 2:00PM where are you, what is your longitude?

Answers

Answer:

From 2007 to 2016 the correct answer would've been Caracas, Venezuela. With a longitude of 66° 56' W.

Their timezone at that time was GMT-4.5, which means they'd be four and a half hours behind GMT.

As of 2021, there are no countries using that timezone for international trade and travel.

Explanation:

Had to make some assumptions. If no other context is given, then this would be the correct answer.

Which of the following was the most significant impact the NEA had on the performing arts industry? W
It created more performance spaces.
O It increased awareness of the performing arts.
It increased production of the performing arts.
O It created more jobs.
Save and Exit
Next
Submit
dan

Answers

Answer:

The NEA’s focus on building new performing arts centers led to an increased production of arts.

What do you understand by the term input, output, processing and storage.​

Answers

Explanation:

The hardware responsible for these four areas operates as follows: Input devices accept data in a form that the computer can use; they then send the data to the processing unit. ... Output devices show people the processed data-information in a form that they can use. Storage usually means secondary storage.

Answer:

input is any information that are given by user and output is the meaningful results that displays in screen and processing means the actions of computer to convert input into output and storage is the last stage where the data and information held for future. I hope you like the answer

Why did the spelling and grammar checkers in Word miss the errors highlighted in yellow?


please help, im vv confused

Answers

Answer:

I do believe that it is a grammar mistake.

The process of generating an image from a 2D or 3D model using computer programs is called ........

Answers

Answer:

endering or image synthesis is the process of generating a photorealistic or non-photorealistic image from a 2D or 3D model by means of a computer program. ... The term "rendering" is analogous to the concept of an artist's impression of a scene.

Other Questions
18 A = {multiples of 5 between 14 and 26} B = {odd numbers between 14 and 26} (a) List the members of A u B (b) Describe the members of A n B Solve the equation |p 8| = 4. Which statement best explains how the pacing revealscharacter in this passage? zoe is buying treats for her dog. Her total bill is $20.25. if each treat cost 0.75 how much treats did she buy? What is the product of 246 and 176? Think about all of the characters Wells includes in The Time Machine; how would you evaluate Wellss character development in this story? What steps does a bill take to become a law Oceanside Bike Rental Shop charges a 15 dollar fixed fee plus 9 dollars an hour for renting a bike. Joan paid 60 dollars to rent a bike. How many hours did she pay to have the bike checked out ? Why can bulimia be harder to detect than anorexia?a. Bulimia has no symptomsb. Bulimia is a mental disorder; anorexia is a physicaldisorderc. People with anorexia recognize that they're sick;people with bulimia don'td. People with bulimia often maintain a normal bodyweight 2) A pool is being filled with a hose. The equation y=12x represents the relationship betweenthe number of gallons of water in the pool (y) and the number of minutes the water runs (X). Ifthis relationship is represented on a graph, which ordered pair would not lie on the line?NEED HELP ASAP PLS AND THANK YOU SO MUCH Choose a food that you love, or one that you really dont like. Write a scene where people are preparing or eating this food. Use sensory language and precise descriptions to get your reader to feel the same way about this food. Which of the following equations have infinitely many solutions?Choose all answers that apply:A- 10x - 10 = -10x + 10B10x - 10 = -10x - 10C- 10x - 10 = -10x - 10D10x 10 = -10x + 10 pls help me with this il give brainliest and max points for a good answer(dont answer if you dont have an liget answer) if u have a question do it in the comments. 4. Which of the following refers to the performance of one or more in with without instrumental accompaniment? Instrumental Music Ensemble b. Vocal Music d. Open what are the top five favorite flavors of ice cream around the world? Read the passage from chapter 5 of Animal Farm.That evening Squealer explained privately to the other animals that Napoleon had never in reality been opposed to the windmill. On the contrary, it was he who had advocated it in the beginning, and the plan which Snowball had drawn on the floor of the incubator shed had actually been stolen from among Napoleon's papers. The windmill was, in fact, Napoleon's own creation. Why, then, asked somebody, had he spoken so strongly against it? Here Squealer looked very sly. That, he said, was Comrade Napoleon's cunning. He had seemed to oppose the windmill, simply as a maneuver to get rid of Snowball, who was a dangerous character and a bad influence. Now that Snowball was out of the way, the plan could go forward without his interference. This, said Squealer, was something called tactics. He repeated a number of times, "Tactics, comrades, tactics!" skipping round and whisking his tail with a merry laugh. The animals were not certain what the word meant, but Squealer spoke so persuasively, and the three dogs who happened to be with him growled so threateningly, that they accepted his explanation without further questions.Which figure from Russian history does Napoleon most likely represent? Please do 17-20! No work needed, please do fast this is due soon! Thank you!! Select another way to show 25 times 18 Find the elapsed time of 8:45AM to 1:10 PM which cyber protection condition establishes a protection priority focus