Write a program that asks the user to enter a series of single digit numbers with nothing separating them. Read the input as a C-string or a string object. The program should display the sum of all the single-digit numbers in the string. For example, if the user enters 2514, the program should display 12, which is the sum of 2, 5, 1, and 4. The program should also display the highest and lowest digits in the string.

Answers

Answer 1

Answer:

#include <stdio.h>

#include <string.h>

int main(){

   char number[100];

   printf("Number: ");

   scanf("%s", number);

   int sum = 0;

   for(int i =0;i<strlen(number);i++){

       sum+= number[i] - '0';

   }

           printf("Sum: %d",sum);

   return 0;

}

Explanation:

This declares a c string of 100 characters

   char number[100];

This prompts user for input

   printf("Number: ");

This gets user input

   scanf("%s", number);

This initializes sum to 0

   int sum = 0;

This iterates through the input string

   for(int i =0;i<strlen(number);i++){

This adds individual digits

       sum+= number[i] - '0';

   }

This prints the calculated sum

           printf("Sum: %d",sum);

   return 0;

Answer 2

The program that ask the user to enter a series of single digit number and display the sum of all the single digit number, highest number and lowest number is as follows:

x = input("input the series of number: ")

y = []

for i in x:

  y += i

integer_map = list(map(int, y))

print(sum(integer_map))

print(max(integer_map))

print(min(integer_map))

The code is written in python.

Code explanation:The first line of code ask the user for the series of numbers. The user input is stored in the variable "x"The y variable is an empty arraywe use the for loop to loop through the users series of number. Then add the looped items to the empty array.Then we map the string of list to an integersFinally, we print the sum , maximum and minimum number of the list.

learn more on python program: https://brainly.com/question/16025032?referrer=searchResults

Write A Program That Asks The User To Enter A Series Of Single Digit Numbers With Nothing Separating
Write A Program That Asks The User To Enter A Series Of Single Digit Numbers With Nothing Separating

Related Questions

Cell address A4 in a formula means it is a _________Mixed cell reference

A. Relative cell reference

B. Mixed cell reference

C. Absolute cell reference

D. All of the above

Answers

Answer:

A. Relative cell reference.

Explanation:

A relative cell reference is like a pointer to a cell or range of cell in Excel. In Excel all cell references, by default, are relative cell references.

In the given instance, the cell address A4 in a formula means it is a relative cell reference. If there would have been a $ sign before A4, then it will be an absolute cell reference. But since, it is without dollar sign, it is a relative cell reference.

Therefore, option A is correct.

How would you open the web browser in Linux and still have access to the Linux terminal?

Answers

Answer:

Use the command "sensible-browser" I could be wrong I have not used linux in some time.

Explanation:

A network manager is interested in a device that watches for threats on a network but does not act on its own, and also does not put a strain on client systems. Which of the following would BEST meet these requirements?

a. HIDS
b. NIDS
c. NIPS
d. HIPS

Answers

Answer:

Option b (NIDS) is the correct choice.

Explanation:

NIDS helps to detect suspicious internet activity. Throughout order to determine all congestion, along with all network packets, unfaithful user information was indeed probably recommended. They were indeed technologies that are already constructively divided up in less than service providers that ineffectively investigate traffic through the systems on something they have been located.

All those other available options aren't closely linked to the scenario in question. Therefore this obvious response is the correct one.

Match the IP Protections Patent, Copyright and Trademark into the following cases:

a. books, poems
b. music, movies, paintings
c. company logo
d. software
e. combinations of materials to make drugs

Answers

Answer:

A) copyright

B) copyright

C)Trade mark

D) copyright

E)Patent

Explanation:

Patent can be regarded as a form of intellectual property which helps the owner of an invention to others to sell or use the invention for some period of time. Example of this is a patent that protect microwave oven.

trademark is form of intellectual property, this could be inform of symbols, words that differentiate the product of a party from another. Example of this is a bite of apple that represents apple products.

Copyright can be regarded as a legal right given to those that owns a intellectual property which gives him/her right to copy and exclude others from reaping from where they did not sow. The owner get exclusive right to reproduce the copy.

Below is the match of the intellectual property with the examples.

a. books, poems<> Copyright

b. music, movies, paintings<> Copyright

c. company logo<> Trademark

d. software<>Copyright

e. combinations of materials to make drugs<> patent

QUESTION 1

Which part of an Ethernet Frame uses a pad to increase the frame field to at least 64 bytes?

Answers

Answer:

Data field.

Explanation:

In Computer Networking, data encapsulation can be defined as the process of adding a header to a data unit received by a lower layer protocol from a higher layer protocol during data transmission. This ultimately implies that, the header (segment) of a higher layer protocol such as an application layer, is the data of a lower layer such as a transportation layer in the Transmission Control Protocol and Internet Protocol (TCP/IP).

Basically, an Ethernet Frame is one of the IEEE 802.3 data encapsulation standards.

An Ethernet Frame can be defined as the building blocks or bits contained in a single packet of data that is being transmitted over an Ethernet network or connection. When data are transmitted, a frame check sequence (FCS) containing a 4-bytes is used to detect or check for any error in a frame and to ensure no frame data was corrupted in the course of the transmission.

In the transmission control protocol (TCP), all frames that are being transmitted must have a minimum of 64-bytes in length and as such when small packets are encapsulated, some additional bits referred to as pad are typically used to increase the frame size to at least 64-bytes, which is the minimum size.

Hence, a data field is the part of an Ethernet Frame that uses a pad to increase the frame field to at least 64 bytes.

Which view displays the records in columns and rows like excel worksheet​

Answers

Answer:

Datasheet View

Explanation:

Chapter 1

A B

Database Template A preformatted database designed for a specific purpose.

Datasheet View The Access view that displays data organized in columns and rows similar to an Excel worksheet.

Question 5
2 pts
The type of control structure that
causes a branch forward at some
point, causing a portion of the
program to be skipped, is:
a selection structure.
O a seguential structure
a repetition structure
a loop structure

Answers

Answer:

Selection structure.

Explanation:

In a decision structure (selection structure), there is a branch forward at some point, which causes a portion of the program to be skipped. A loop structure (repetition structure) contains a branch to a previous statement in the program module, which results in a block of statements that can be executed many times.

Other Questions
A mouse is running across a room with a speed of 2.2 m/s. The mass of the mouse is 1.4 kg. What is the Kinetic Energy of the mouse? Please help Im doing exams. The Southeastern Native Americans were often in conflict with all of the following groups except:a.French settlersb.Spanish settlersc.Anglo American settlersd.other Native American groupsPlease select the best answer from the choices providedABCD -2x-9y=-25-4x-9y=-23Solution -1,3 Nicholas started a canned-food drive at school. The equation representing this is y = 235x + 15, where x is the number of days, and y is the number of cans collected. Explain how to determine how many days it would take to collect 2600 cans.WILL GIVE BRAINLIEST What single resistor could replace 20 , 30 and 50 resistors which have been joined in series ? PLEASE HELP MEEEEEE i'll be your best friendddd ;-;The resale value of a textbook decreases by 25% with each previous owner. A new textbook is sold for $85. Which function represents the resale value of the textbook after x owners?A: f(x) = 85(1 0.25)xB: f(x) = 85(1 + 0.25)xC: f(x) = 85(0.25)xD: f(x) = (85 0.25)x balance these equations 1. Junior states, "Adults are so good at smiling mysteriously. Do they go to college forthat?" What do you think he means by this? (01.02 MC)Which number line shows the solution to 3 (1)? A number line is shown from negative 5 to 0 to positive 5. There are increments of 1 on either side of the number line. All the numbers are labeled on either side of the number line. An arrow pointing from 0 to negative 3 is shown. Above this, another arrow pointing from negative 3 to negative 4 is shown. A vertical bar is shown at the tip of the arrowhead of the top arrow. A number line is shown from negative 5 to 0 to positive 5. There are increments of 1 on either side of the number line. All the numbers are labeled on either side of the number line. An arrow pointing from 0 to 3 is shown. Above this, another arrow pointing from 3 to 4 is shown. A vertical bar is shown at the tip of the arrowhead of the top arrow. A number line is shown from negative 5 to 0 to positive 5. There are increments of 1 on either side of the number line. All the numbers are labeled on either side of the number line. An arrow pointing from 0 to negative 3 is shown. Above this, another arrow pointing from negative 3 to negative 2 is shown. A vertical bar is shown at the tip of the arrowhead of the top arrow. A number line is shown from negative 5 to 0 to positive 5. There are increments of 1 on either side of the number line. All the numbers are labeled on either side of the number line. An arrow pointing from 0 to 3 is shown. Above this, another arrow pointing from 3 to 2 is shown. A vertical bar is shown at the tip of the arrowhead of the top arrow. Under the modern traditional theory, the sovereign may nationalize foreign-owned property only where: a. it is for a public purpose. b. the foreign firm that owned the property was operating it unprofitably. c. a communist government takes over the country. d. the foreign firm has continuously violated the laws of the host country. PLEASE HELP!!! WILL MARK BRAINLIEST IF YOU UJSE AN EXPLANATION!!!What would seasons be like if Earths axis were tilted more than 23.5? Then use the Gizmo to test your prediction and answer complete the question/statement below. Based on the fact that no tilt results in ___ seasons, a more tilted axis will result in___seasons.1st blank- A- noB- moreC- more extreme2nd blank-A- more extremeB- noC- less extreme PLEASE HELP MEEE!!!Which fraction is equivalent to a ratio of 3 to 4? Apply distributive property to 24a-18b Can anyone help me out with these questions? Thanks!! . Transcribe this DNA strand:AGCTACTAGCAAT What is f(3) in the graph below?* Organisms are made of parts that work together to form a living system. The smallest functional unit of life in an organism is knownasOA a cel.an organ systemOCa tissue Ano ang antas ng teknolohiya sa Mesopotamia? Please answer.. I really need help.. What is the difference between a simile and a metaphorHow different two compared things are How many things are being compared How often a poet is using comparisons How strongly two thins are being compared Can some one help please I dont understand this problem.This is for regular Geometry.