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
antoniya [11.8K]
3 years ago
6

C programming question

Computers and Technology
1 answer:
Firdavs [7]3 years ago
6 0

Answer:

int digitSum(int n) {

int sum = 0;

while (n) {

 sum += n % 10;

 n /= 10;

}  

return sum < 10 ? sum : digitSum(sum);

}

int main()

{

int n = 12345;

printf("Digit sum of %d is %d\n", n, digitSum(n));

}

Explanation:

The recursion takes care of the repeated summing in case the sum has more than 1 digit.

You might be interested in
Does someone know what type of usb is that one called?
Doss [256]
It is USB 2.0 mini b 5 pin

3 0
3 years ago
Read 2 more answers
1. Conflict resolution is the process of solving disputes and disagreements.
gtnhenbr [62]
1. Conflict resolution is the process of solving disputes and disagreements.

A. True


2. Project managers have the overall responsibility for planning, executing, and completing a project.

A. True


3. Read the following scenario:

A project will require more people than originally estimated.

Identify the possible risks to the project.

B. Money and resources


4 0
3 years ago
Bro how the hell do u do full screen on windows
Rudik [331]

Answer:

You'll need to hold down/click<em> </em>f11 and fn at the same time.

If not that, try ctrl + shift + f5.

I can guarantee the first works; not too sure about the second.

Explanation:

Well, it's hotkeys, so...

<em>EDIT: The f5 command does nothing related to full screen, my bad.</em>

7 0
3 years ago
Read 2 more answers
Where did these networks get the name p2p
otez555 [7]
From the creator of the network
8 0
3 years ago
Python please!
riadik2000 [5.3K]

We have that the output that frequency with the next 4 higher key <u>frequencies  </u>is <em>mathematically </em>given as

Output

  • 120,127,13,134.8,142,1,151.19

From the question we are told

  • On a piano, a key has a frequency, say f0.
  • Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12).
  • Given an initial key <em>frequency</em>, output that <em>frequency</em> and the next 4 higher key <em>frequencies</em>.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

<h3> Output and frequency</h3>

Generally the code will go as follows

# The key frequency

f0 = float(input())

r = math.pow(2, (1 / 12))

# The frequency, the next 4 higher key f's.

frequency1 = f0 * math.pow(r, 0)

frequency2 = f0 * math.pow(r, 1)

frequency3 = f0 * math.pow(r, 2)

frequency4 = f0 * math.pow(r, 3)

frequency5 = f0 * math.pow(r, 4)

# printing output

print('{:.2f} {:.2f} {:.2f} {:.2f} {:.2f}'.format(frequency1, frequency2, frequency3, frequency4, frequency5))

Therefore

Output

120,127,13,134.8,142,1,151.19

For more information on frequency visit

brainly.com/question/22568180

3 0
3 years ago
Other questions:
  • A directional antenna issues wireless signals along a(n) ____ direction.
    9·1 answer
  • The ________ defines every object and element on a web page.
    13·1 answer
  • What is the simplest way to permanently get rid of an unwanted file? A. Cancel the file. B. Go to the Start menu and then delete
    14·1 answer
  • Instructions:Select the correct answer.
    8·2 answers
  • PLEASE HELP WITH THESE QUESTIONS!!!! 19 POINTS!!!!!
    14·2 answers
  • Write a VB.Net program to print numbers from 10 to 20 in descending order using a For Statement.
    14·1 answer
  • N men and N women were participating in a stable matching process in a small town named Walnut Grove. A stable matching was foun
    12·1 answer
  • Uinjsiodj9fijsdiokjdwe0okakj09dw9j09jw09
    9·2 answers
  • Factoring is the revers of​
    14·1 answer
  • What are possible consequences for cyberbullying?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!