c programming question


Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. The input will be a non-negative integer.

Answers

Answer 1

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.


Related Questions

Which of the following statements about software licensing are true? Select 3 options.

A. Both proprietary and open-source software can be modified and redistributed.

B.Free software does not come with a license.

C.Open-source software allows developers to create new software more quickly and inexpensively.

D. Proprietary software licenses are more restrictive than open-source software licenses.

E. An end-user license agreement protects both the owner of the software and the purchaser.

Answers

Using software licensing concepts, it is found that the correct options are given by:

A. Both proprietary and open-source software can be modified and redistributed.

C.Open-source software allows developers to create new software more quickly and inexpensively.

D. Proprietary software licenses are more restrictive than open-source software licenses.

------------------------

A proprietary software is owned by an enterprise(can be both an individual and company) that produced it, while a free software means that anyone can make changes in it.Changes can also be made in a proprietary software, just an authorization from it's owner is needed, and thus, option A is correct.Both types have licenses, and thus, option B is incorrect.Since anyone can change it, in an open-source software the developers can create new software quickly, while proprietary licenses are more restrictive, thus, options C and D are correct.An end-user license agreement protects the owner of the software from it being changed without permission, that is, just the owner, thus option E is incorrect.

A similar problem is given at https://brainly.com/question/14721871

Answer: these are the correct answers

Explanation:

A computer is an.............. device.​

Answers

Explanation:

A computer is an electronic device

Answer:

Computers are electronic devices that process information.

OUTPUT DEVICES 1. Match each output device on the left with the correct use on the right. Output device Use Multimedia A large monitor used by older computers Projector Used when checking the depth of water in a container Buzzer Used for outputting large posters, maps and plans Light A thin light weight monitor Wide format printer Used to make presentations to a large audience Dot matrix printer Used for producing mutli-part invoices CRT monitor Used as an alert on smartphones TFT/LCD monitor​

Answers

Answer:

hand

Explanation:

My name is Yoshikage Kira. I'm 33 years old. My house is in the northeast section of Morioh, where all the villas are, and I am not married. I work as an employee for the Kame Yu department stores, and I get home every day by 8 PM at the latest. I don't smoke, but I occasionally drink. I'm in bed by 11 PM, and make sure I get eight hours of sleep, no matter what. After having a glass of warm milk and doing about twenty minutes of stretches before going to bed, I usually have no problems sleeping until morning. Just like a baby, I wake up without any fatigue or stress in the morning. I was told there were no issues at my last check-up. I'm trying to explain that I'm a person who wishes to live a very quiet life. I take care not to trouble myself with any enemies, like winning and losing, that would cause me to lose sleep at night. That is how I deal with society, and I know that is what brings me happiness. Although, if I were to fight I wouldn't lose to anyone.

What If smart phones / computers didn't exist?

Answers

Answer:

If the smart phones/ computers do not exist we wouldn't be able to communicate with the peoples or with our family members in the case when we are far from them. It has given us acess to : entertainment, family bonding social surrogacy e.t.c. Social interactions would be enhanced, and all the social dramas would not exist as much as it does now. Thus, it has a significant role in our life.

Using a combination of symmetric and asymmetric key encryption, Sofia sent a report to her home office in Indiana. She received an e-mail acknowledgement that her report had been received, but a few minutes later she received a second e-mail that contained a different hash total than the one associated with her report. This most likely explanation for this result is that

Answers

Group of answer choices.

A) the public key had been compromised.

B) the private key had been compromised.

C) the symmetric encryption key had been compromised.

D) the asymmetric encryption key had been compromised.

Answer:

C) the symmetric encryption key had been compromised.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

In Cyber security, encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext.

Typically, an information or data that has been encrypted can only be accessed and deciphered by an authorized user.

Some examples of encryption algorithms are 3DES, AES, RC4, RC5, and RSA.

Email encryption is the encryption and authentication of an email to protect the message therein from being read by any person other than the intended recipients. Thus, it protects the email from hacking or invasion by a third party.

Basically, when the message is signed with the sender's private key, the receiver can verify its authenticity using the sender's public key.

Also, encrypting the email message with the receiver's public key provides confidentiality.

In this scenario, the most likely explanation for this result is that the symmetric encryption key had been compromised.

you’ve found an image you want to insert into your slide presentation you want to make the image look more gray so that it looks like an older image what would you need to adjust

Answers

image grayscale

format : format options: recolor : then pick the color

Which of these functions may be used with positional arguments? Select four options.

AVERAGE
COUNTIF
COUNT
SUM
MAX

Answers

Answer:

AVERAGE

COUNT

SUM

MAX

Explanation:

The functions that may be used with positional arguments include:

AVERAGE

COUNT

SUM

MAX

The basic functions formulae include SUM, AVERAGE, COUNT, MAX and MIN.

SUM: This is the sum total of all the numbers in the rows.

COUNT: This is the used to count the range of cells that contains numbers.

AVERAGE: This is the average of all the numbers in the rows.

MIN: This is the lowest number in the rows.

MAX: This will return the highest number that is found in the set of values.

It should be noted that the COUNTIF is not used with positional arguments.

what is internet?
what is online?​

Answers

Answer:

internet: The Internet is a vast network that connects computers all over the world. Through the Internet, people can share information and communicate from anywhere with an Internet connection.

online: controlled by or connected to a computer., while connected to a computer or under computer control.

What stage in the process of media production involves discussing the budget and timelines as well as identifying stakeholders? create/develop upload/display research/define plan/design

Answers

Answer:

research/define

It is C

hardware and software are........... to each other​

Answers

Answer:

Hardware and software are interconnected to each other​

Hope this is what you´re looking for!

(a) Rewrite the following using if else statement:
int x;
String s=(x%3=0)? “Divisible by 3" : "Not divisible by 3";
System.out.println(s);​

Answers

Answer:

int x;

String s;

if ((x%3) == 0) {

   s = "Divisible by 3";

} else {

  s = "Not divisible by 3";

}

System.out.println(s);​

Explanation:

A : B ? C generally translates to if (A) { B } else { C }.

Note the == to compare to 0. The single = in the original expression is a mistake.

Nama prinsip kerja mouse adalah

Answers

Answer:

Mampu bekerja di hampir semua permukaan, mouse memiliki light-emitting diode (LED) merah kecil yang memantulkan cahaya dari permukaan itu ke sensor semikonduktor oksida logam (CMOS) komplementer. Sensor CMOS mengirimkan setiap gambar ke prosesor sinyal digital (DSP) untuk dianalisis.

in english

Able to work on almost any surface, the mouse has a small, red light-emitting diode (LED) that bounces light off that surface onto a complementary metal-oxide semiconductor (CMOS) sensor. The CMOS sensor sends each image to a digital signal processor (DSP) for analysis.

You are the Administrator for a large company that has offices around the world. Each office has employees in the Sales department and each location has created their own Sales folder for storing important Sales related files. You would like to implement a Window Role to minimize the duplication of files within the Sales department. Which File System can you install as a Windows Role to help you accomplish this goal?

Answers

Answer:

Transactional File System

Explanation:

To minimize the duplication of files within the Sales department. Transactional File System can make multiple file system changing, and if there is an error on one of the files then there will be no change.

Which formatting group would commonly be used for monetary figures?

number
general
accounting
currency

Answers

Answer:

currency.

Explanation:

A word processor can be defined as a software application or program designed to avail the end users the ability to type and format text documents for various purposes.

Some examples of word processors are Notepad, Microsoft Word, etc.

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

Formatting in Microsoft Word refers to the appearance of texts in a document.

Basically, to format a text typically involves performing tasks such as, bold, underline, italics, font-size, font-types, color, etc.

The commands to perform the above tasks are mainly found in the format menu of the Home tab.

In Microsoft Word, you can set the display format for date, percentage, number, and currency (monetary figures). Thus, this format styles define how these values are displayed in charts and tables.

In this context, the formatting group which is commonly used for monetary figures (numerical data) such as dollar, euro, yen, naira, etc., is called currency.

Answer:

I think the answer is D

Have a good day!

A security operations team was alerted to abnormal DNS activity coming from a user's machine. The team performed a forensic investigation and discovered a host had been compromised. Malicious code was using DNS as a tunnel to extract data from the client machine, which had been leaked and transferred to an unsecure public Internet site. Which of the following BEST describes the attack?
A. Phishing
B. Pharming
C. Cache poisoning
D. Data exfiltration

Answers

Answer:

D. Data exfiltration

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, sniffing, data exfiltration, etc.

The type of attack in this scenario is best described as data exfiltration.

Data exfiltration can be defined as a form of data security breach that typically involves an unauthorized transfer of data from a host computer by using a malware and a malicious code.

Hence, data exfiltration occurs when a malicious code uses a domain name server (DNS) as a tunnel to extract data from an end user's computer (client machine) and transferring it to an unsecure public Internet site.

What defines interactive media? The user must play a role in writing the content of the media. The user must do something that determines what happens next. The user must help design the overall look and feel of the presentation. The user must provide feedback after using the media.

Answers

Answer:

What Is Interactive Media?

Interactive media is a method of communication in which the program's outputs depend on the user's inputs, and the user's inputs, in turn, affect the program's outputs. Simply put, it refers to the different ways in which people process and share information, or how they communicate with one another. Interactive media allows people to connect with others—whether that's people or organizations—making them active participants in the media they consume

Answer:

The user must do something that determines what happens next.

It is B.

What is ABC computer?​

Answers

Answer: The Atanasoff–Berry computer was the first automatic electronic digital computer. Limited by the technology of the day, and execution, the device has remained somewhat obscure. The ABC's priority is debated among historians of computer technology, because it was neither programmable, nor Turing-complete.

Explanation:

Can someone answer this, I'll mark u the brialintest

Answers

Answer:

d

Explanation:

Decimal equivalent of "D" = (D) 13 × 16^1

You are concerned about attacks directed at your network firewall. You want to be able to identify and be notified of any attacks. In addition, you want the system to take immediate action to stop or prevent the attack, if possible. Which tool should you use

Answers

Answer:

Intrusion Prevention System (IPS)

Explanation:

Firewall can be defined as a network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules.

Simply stated, a firewall is a network security protocol that monitors and controls inbound and outbound traffic based on set aside security rules.

A firewall is used to control access to a computer or network, as it creates a barrier between a computer or a network and the internet in order to protect against unauthorized access.

Basically, it is a network security device or security system pre-installed on most computers to essentially inspect data being transmitted to or from a computer

Thus, the tool you should use is an intrusion prevention system (IPS).

14. Applying formatting using the commands in the ribbon is called style
(page layout, override, justification)

Answers

Answer:

Override

Explanation:

Hope this helps

(11011+1001) base 2
please slove this​

Answers

Answer:

Explanation:

We can convert both to base 10 first:

(1+2+8+16) + (1+8) = 36.

Converting back to base 2, we get

100100

NBA bank uses centralized client server database that is accessed by all its nationwide branches. All customers' records are stored on the database. There are no copies at the branches. The building that holds this database and all the equipment went up in flames and was destroyed.

Answers

Answer:

NBA bank data is completely destroyed since it has not maintained any backup.

Explanation:

All businesses should maintain backup of important records. NBA bank has centralized client server database. This database record should be backup at different system which is only accessed when there is some problem in the original data. The backup system is initiated when the original database is destroyed.

Angelina has added page numbers to her report, but all of the pages are labeled "Page 1” at the bottom. What caused this issue?
She typed “Page 1” in the footer.
She added a header instead of a footer.
She did not create a numbered list in her footer.
She forgot to click the Continue Numbering option.

Answers

Answer:

She typed "Page 1" in the footer.

Explanation:

This occured because the footer only repeats the same message across the footers unless you enable page numbering.

Hope this helps!

Define Data communication​

Answers

Explanation:

Data transmission and data reception is the transfer and reception of data over a point-to-point or point-to-multipoint communication channel. Examples of such channels are copper wires, optical fibers, wireless communication channels, storage media and computer buses. 

are the exchange of data between two devices For data communications to occur, the communicating devices must be part of a communication system made up of a combination of hardware

After completing initial diagnostic procedures and allocating system resources, a startup BIOS program checks for information about secondary storage devices that might contain the OS. The list of devices and the order in which they should be checked can be found and arranged in the CMOS setup utility. This option is commonly referred to as a:

Answers

Answer:

Boor sequence

Explanation:

How is IT used in entertainment to make cartoon movies

Answers

Answer:

Forensic animation is a branch of forensics in which animated recreation of incidents are created to aid investigators & help solve cases. Examples include the use of computer animation, stills, and other audio visual aids.

hope you will get this answer correct

What is the primary difference, if any, between a web master and a web producer? While a web master maintains a company’s websites, the web producer maintains a company’s entire web-based system. While a web producer maintains a company’s websites, the web master maintains a company’s entire web-based system. While a web master maintains a company’s web presence, the web producer maintains all technology at a company. While a web producer maintains a company’s web presence, the web master maintains all technology at a company.

Answers

Answer:

While a web master maintains a company’s websites, the web producer maintains a company’s entire web-based system.

I'm assuming that's A

Write an algorithm and draw a flowchart for switching off a machine after it has made 500 glass bottles. use an appropriate conditional statement for this
please hurry i need urgent
please answer correct
or i will report

Answers

The algorithm is as follows:

1. Start

2. bottles = 0

3. While bottles != 500

3.1 Create bottle

3.2 bottle = bottle + 1

4. Switch off machine

5. Stop

Explanation:

This begins the algorithm

1. Start

This initializes bottles to 0

2. bottles = 0

The loop is repeated until 500 bottles is created

3. While bottles != 500

This creates a new bottle

3.1 Create bottle

This increments the number of bottles by 1

3.2 bottle = bottle + 1

This switches of the machine after all bottles are created

4. Switch off machine

End algorithm

5. Stop

THANKS

In what way, if any, has community building changed in the age of digital media? People’s community building has not changed in the age of digital media. People are now more willing to share highly personal information with strangers. People are now far less interested in building community or connecting with others. People are now more interested in forming communities based on physical location.

Answers

Answer:

People are now more willing to share highly personal information with strangers. Match each type of digital health, wellness, and security with examples of potential violations.

A program in the cyberspace and intercept messages containing specific text A. Virus B. Sniffers C. Worm D. Bomb

Answers

Answer:

B. Sniffer

Explanation:

The type of program that is being discussed is called a Sniffer. This can either be a software or hardware that allows the user to intercept data flowing from a computer to the internet in real-time before it reaches its destination. The program can be very vague and intercept all the data coming and going to the target computer or it can be very specific and intercept only the data in which it was programmed to target (sniff out). Cyber Criminals use these programs/devices to steal valuable information that they know a user is going to send sooner or later over the internet.

Other Questions
Decide whether the graphs of the two equations are parallel. y=3x+8 and y/3-3=x If sales are $798,000, variable costs are 72% of sales, and operating income is $258,000, what is the contribution margin ratio? a. 72% b. 68% c. 28% d. 32% The length of a rectangle is five times its width. If the perimeter of the rectangle is 108 in, find its area. Tamarisk, Inc. issued 20800 shares of $1 par common stock for $40 per share during 2022. The company paid dividends of $50000 and issued long-term notes payable of $458000 during the year. What amount of cash flows from financing activities will be reported on the statement of cash flows What is consciousness? ... Find the missing side lengths leave your answer as a racials simplest form What table represents a linear function Select the correct answer from each drop-down menu.The United States and the Soviet Union avoided nuclear war because they did not engage inwith one another.However, both chose to fight wars by providing military assistance to their allles in smaller conflicts. Find the value of x for which ABCD must be a parallelograma. 1b. 94c. 3d. 47 After several miles of running and sprinting in intervals, the runners muscles ache and feel fatigued. Which is the best explanation for what has occurred?a. The runner's muscles have accumulated lactic acid.b. The runners body has failed to perform cellular respiration.c. The runners cells are relying completely on aerobic respiration.d. The runners muscles have accumulated carbon dioxide. What is the equation of the following line? Be sure to scroll down first to see all answer options. A. y = 18x B. y = 9x C. y = -9x D. y = - x E. y = -18x F. y = x For me, reading has always been a path toward liberation and fulfillment. To learn to read is to start down the road of liberation, a road which should be accessible to everyone. No one has the right to keep you from reading, and yet that is what is happening in many areas in this country today. There are those who think they know best what we should read. These censors are at work in all areas of our daily lives.Which best describes how Anaya uses rhetorical appeal to convince readers that censors want to limit what people can read?(A)Anaya speaks about everyones right to read what they choose in order to appeal to the readers sense of fairness.(B)Anaya presents documented facts about censors motivations in order to appeal to the readers sense of logic. (C)Anaya discusses his lifelong love of reading in order to establish his expertise for the reader on the topic of censorship.(D)Anaya refrains from stating a direct opinion in order to allow the reader to form one based on evidence from many areas of the country. A truck is said to get 18 miles per gallon on a highway, but this value can fluctuate, at most, by 4 miles per gallon. Which of the following absolute value inequalities matches this scenario? Question 23 options: |x + 18| 4 |x 18| 4 |x 4| > 18 |x + 18| > 4 If we slowly add a solution of mercury(II) ions to a solution of aqueous halide ions with roughly equal concentrations, a precipitate will form. Explain what the precipitate will consist of initially. g HELP PLEASE! Write and solve the equation: The squares are identical. What is the area of each square? (Q022) A negative magnetic anomaly a. occurs when the Earth's magnetic field measured in ancient rocks is the same as it is today. b. is created when weak magnetic forces in basalt grains add to the force produced by the Earth's dipole. c. describes the sawtooth pattern of magnetic signal strength measured along the Atlantic Ocean seafloor. d. is indicated when a magnetometer measures intervals of magnetism that are weaker than expecte The number of grams of helium in a balloon at a pressure of 99.8 kPa, a temperature of 301 K, and a volume of 0.785 L would beOptions:814 g0.125 g0.278 g337 g g Identify the process in which the entropy increases. Group of answer choices a decrease in the number of moles of a gas during a chemical reaction the phase transition from a gas to a liquid the phase transition from a solid to a gas freezing water Is my sketch beautiful??? made by:ME The slopes of 2 lines are in the attachment. what is the value of a that will make the lines PARALLEL and PERPENDICULAR