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
Windows uses a memory-management technique known as ________ to monitor which applications you frequently use and preloads them
ad-work [718]
Windows uses a memory-management technique known as SuperFetch to monitor which applications you frequently use and preloads them into your system memory.
This technique is designed to speed up app launching by preloading certain apps based on the usage patterns of the user.

4 0
3 years ago
When making college visits, you may be able to....
solmaris [256]
-schedule a tour to college campuses
- Attend a class to find out how its feels like
5 0
3 years ago
Read 2 more answers
What does aperture control? A)amount of light the image sensor captures when taking a photo. B)how sensitive the camera is to in
My name is Ann [436]

Answer:

How sensitive the camera is to incoming light.

Explanation:

8 0
4 years ago
Read 2 more answers
Write a short note on Ms - Excel...​..
sweet-ann [11.9K]

Answer:

Microsoft Excel is a spreadsheet program. It provides a grid interface to organize the various information. You can use Excel to create and format workbooks in order to analyse the data. Specifically, you can use Excel to track data, build models for analysing data, write formulas to perform calculations on that data, pivot the data in various ways, and present data in a variety of professional looking charts. Excel is used widely in financial activity. It has the ability to create new spreadsheets where users can define custom formulas for the calculation. Excel is also used widely for common information organization and tracking like a list of sales leads, project status reports, contact lists, and invoicing. Excel is also useful tool for scientific and statistical analysis with large data sets.

3 0
3 years ago
Write a Java code statement for each of following:
Naddik [55]

Answer:

double decimal1, decimal2;

int whole;

Explanation:

Required

Declare 2 decimals and 1 int.

The syntax to declare a variable is:

<em>data-type variable-name;</em>

To declare decimal, we simply make use of double or float data types.

So, we have:

double decimal1, decimal2; ----> for the decimal variables

And

int whole; ---- for the whole number

6 0
3 years ago
Other questions:
  • 50 pts
    12·2 answers
  • The ____ keyword specifies that a function or method does not return a value.
    5·1 answer
  • The ____________________ packet-filtering firewall allows only a particular packet with a particular source, destination, and po
    10·1 answer
  • The purpose of the _____ element is used to configure the footer information ona web page document
    6·1 answer
  • Please I need help with this !!!! <br> Complete the table given below.
    8·1 answer
  • Write a user written function that expects as its input argument a vector of x values and a vector of corresponding y-values. Th
    15·1 answer
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device br
    13·1 answer
  • 1. Answer the following questions: a. What are the different types of number system? Name them.​
    8·1 answer
  • An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
    8·1 answer
  • Which company provides a crowdsourcing platform for corporate research and development?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!