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

How does a computer virus spread?​

Answers

Some most common methods are phishing emails, USB and removable media

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

Answers

Answer:

ARP is a simple query–response packet protocol used to match workstations hardware addresses to IP addresses. In other words, ARP is the protocol used to identify nodes in a LAN. ARP is described in RFC 826

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 :(



does industry-recognized certifications (microsoft office suite) boost your resume and
increase your earning potential?

Answers

Answer:Having Microsoft Office training can make you more productive, confident, and satisfied with your job. ... Productivity is crucial to success in the administrative assisting field, and your employers will thank you for it. 3. Industry-recognized certification will boost your resume and increase your earning potential.

Explanation: i no it

what is a program or collection of programs that enable a person to manipulate a visual images on a computer​

Answers

In computer graphics, graphics software refers to a program or collection of programs that enable a person to manipulate images or models visually on a computer. ... In addition to static graphics, there are animation and video editing software.

IT professionals ensure servers connected to the network operate properly. (2 points) True False

Answers

Answer:

True

Explanation:

Thats one of their most important jobs

How many 60 KB jpeg files can be stored on a 2 MB folder in your hard drive?​

Answers

Answer:

2 MB = 2048 kb

2048 / 60 = 34.1

Explanation:

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.

A brief communication used in businesses is called a _____.

hard copy
document
memo
research paper

Answers

Answer:

C. Memo

Explanation:

Hope this helps :)

Answer:

the answer is it is called a memo

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

I will mark brainlist please help


1) Top layer we used the following effect

• clipping mask

• release clipping mask

• rasterize type

• none of the above


2) Reflection layer blend mode changed to:

• overlay

• normal

• dissolve

• hard light



3) for the layer reflection copy we added

• input mask

• color overlay

• layer mask

• none of the above

Answers

Answer:

C,A,B

Explanation:

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

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:

ctivity 2: irections: Convert the given value to unit asked. 1. 1 tb 2. 500 mb 3. 200 kb 4. 1,000,000 bytes 5. 500 gb mb gb byte gb mb

help please​

Answers

Answer:elab

Explanation:

Language is Python
9.9 LAB: Count input length without spaces, periods, exclamation points, or commas

Given a line of text as input, output the number of characters excluding spaces, periods, exclamation points, or commas.

Ex: If the input is:

Listen, Mr. Jones, calm down.
the output is:

21

Answers

Answer:

text = input('Please enter a line of text')

text = text.replace(" ", "")

text = text.replace(".", "")

text = text.replace("!", "")

text = text.replace(",", "")

print(len(text))

Explanation:

i answered this same exact question the other day.

line by line, the first line asks for input with a prompt.

the second line replaces spaces, the next one replaces periods, the next exclamation marks, the next commas. then the last line prints the total number of characters

In this exercise we have to use the computer language knowledge in python to write the code as:

the code is in the attached image.

In a more easy way we have that the code will be:

text = input('Please enter a line of text')

text = text.replace(" ", "")

text = text.replace(".", "")

text = text.replace("!", "")

text = text.replace(",", "")

print(len(text))

See more about python at brainly.com/question/26104476

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

Advantages of communications​

Answers

Answer:

promotes team building

creates better relationship

Answer:

➨It is quick in obtaining feedback once delivered. ➨It provides complete understanding of communication delivered and there is chance to make it more clear in case of doubts in interpretation of words or ideas. ➨It is more reliable method of communication. ➨It is flexible and effective for all.

How have computers affected education?​

Answers

Explanation:

Computers have supplied infinite resources for learning and made education more flexible and easy to access. Students can now gain knowledge and information not only from classroom assignments and libraries but also from available online resources.

Computers provide teachers and students the means to communicate quickly via email. Online grading systems also make it easier to view and audit a student's progress. In addition, computers open doors to social media, providing students and teachers tools to interact, collaborate and communicate.

Which is an example of a demand account

Answers

Answer:  savings account investment account credit account checking account Checking account is an example of a demand account.

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

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

Why would you use a computer's secondary memory?
O A. To look at files created on your home computer on a public
computer
B. To run word processing software on your computer
O C. To save a slide show presentation on your computer
D. To start up your computer and perform its basic tasks

Answers

Answer:

I think B

Explanation:

Secondary storage is needed to keep programs and data long term. Secondary storage is non-volatile , long-term storage. Without secondary storage all programs and data would be lost the moment the computer is switched off.

A computer's secondary memory would be used to look at the files created on the home screen of the computer.

Option A is the correct answer.

A computer is an electronic device that is used to do various kinds of operations automatically.

Now, Secondary memory can be utilized to store the data or information which can be instantly recovered.

It is also known as backup memory. USB drives, hard disk drives, optical drives, etc. are some examples of secondary memory.

Therefore, the task of locating the files in the computer is to be done by using the computer's secondary memory. So option A is true.

Learn more about the secondary memory in the related link:

brainly.com/question/24901228

#SPJ6

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

Answers

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

Explanation: (0L0)

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.

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

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.

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

Why do we create user accounts to customize our preferences​

Answers

I feel like we should create our own account for

security purpuoses   it's a good idea for each user to have their own account. Everyone having their own account is better for security reasons. For instance no one can access anyone else's account without their password.

Select the correct locations on the image.
In which of these images would the rule of thirds become an evaluating factor?

Answers

Answer:

apple

Explanation:

the one of the apple is right

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
Other Questions
what type of energy is the sum of kinetic and potetinal energy in an object that is used to do work Write a well-constructed essay supporting either Andrew Jackson or the re-election of John Quincy Adams. Point M(-6,8) is dilated from the origin with a scale factor of 1/2. What is the coordinate of M'? * see screenshot below/above Arden has 7/8th yard of ribbon. What is the maximum number of 1/16th yard-long pieces Marilyn can cut from this ribbon? Find the slope of the line that contains the following pair ofpoints:(-3,-4) and (3,-2). Show your work on this I will mark as brainliest as well Assume that y varies inversely as x. IfYy = 10 when=x = 4, what is the value for y whenx = 6? Define and explain the Triangle Trade. Explain two ways that it has shaped the American colonies. Solve for X: square root 2x power of 2 +5 = 2A. plus and minus 1 B. square root 2 C. plus and minus 2 D. no solution someone please help me what were the motives of the US acquisitions of territories Help fasttttt the first correct answer I will give brainliest!!!! the quotient of 49 and a number Write a story based on the outline given below What is the product?(4x) {-3x^8}{-7x^3} Triangles PQR and XYZ are similar. What is the length of XZ? does the welland canal have locks? how do u know? The main causes of world war 1 20 HELP PLEASE!! I'LL GIVE BRAINLIST!!!!What science topic interests you most? Find an example of science writing related to that topic and analyze its type and structure. Identify the articles purpose and intended audience, and describe the features that reveal what type of scientific text it is. Be sure to include the articles title and author(s).