Write c code to repeatedly ask the user for a number

Assignment Help Computer Engineering
Reference no: EM132194438

Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered.

To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements.

To implement the above code, you will need to count the entries - name the counter variable num_count.

You will also need to use a variable, name it min_in so each time the user gives input, and the input is not 0, then compare min_in with the input, if the min_in is > input, then assign min_in to the input.

Similarly name another variable max_in, and compare it to the input, but assign max_in to the input only if max_in is < input.

To calculate the average, accumulate each input into a variable, total. Then after the loop the average is the total divided by the number of entries.

Once the loop is over, display the calculated values (min, max and the average) with a proper wording in three lines. The input is not restricted to integer value so declare the variables above with a proper type. Show the output using two decimal places, and align the three output values as in this sample output:

The minimum entry was: 2.30

The maximum entry was: 62.51

The average of all entries was: 52.81

Reference no: EM132194438

Questions Cloud

Print each element of the array print the sum : Call function sum with the array and size as parameters. Print each element of the array Print the sum .
A string of space-delimited integers from an external file : Write an C code that reads a string of space-delimited integers from an external file ("whatin.txt"), stores them in the stack.
Describe the company culture based on your analysis : Evaluate whether the company's actions seem to align with their vision and mission statements. Describe the company's culture based on your analysis.
What would your investment portfolio look like : Assignment Details: Assume that you were given $100,000 to invest in financial assets. What would your investment portfolio look like?
Write c code to repeatedly ask the user for a number : Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered.
Implications for the development of future leaders : What are the major implications for the development of future leaders as it pertains to crisis leadership?
Describe the facets of crisis management : Describe the facets of Crisis Management and how each facet impacts on the organization.
What is the concept of influence process : What is the concept of influence process? How do you find these concepts and how they are used daily?
How various public health goods and services are delivered : To what extent are various public health goods public or private? Why is it important for you, given your current or future professional role.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How you would advise your current employer to use encryption

Discuss, in 500 words, how you would advise your current employer to use encryption to reduce the vulnerabilities of their data at rest, in use, and in transit.

  Cmg is also considering expansion into other markets

CMG's IT department consists of about 70 people. The department is broken up into the Technical Services group and an Application Development group. Project managers, business analysts, and application developers are within the application develop..

  Explain the various sampling concepts

Various Sampling Concepts. You overheard the following comments during a conversation between Roger Nadal and Rafael Federer about a specific sampling.

  We will be using a very robust fast and efficient automated

we will be using a very robust fast and efficient automated inferencing system with support for disjuction and

  Is there the standard for drc

I would like to ask a question about Disaster Recovery Site Certification? Is there certification for DRSC for computers and application? Is there a standard for DRC.

  Describe the types of checks and balances

Please define the goals of an access control monitoring system. Describe the types of checks and balances that should be implemented into a network's design.

  Write a paper on rfid standards which apply to your industry

Write a 4 page research paper on the RFID standards which apply to your selected industry. If there are no specific standards that you think apply to your selec

  Examine recursive function computation of fibonacci numbers

Examine the recursive function computation of Fibonacci numbers. Note that each Fibonacci number is recomputed many times.

  Prompt the user for a character or string of characters

Write a new program that will prompt the user for a character or string of characters.

  What are the five basic components of a computer

What are the five basic components of a computer? What is the difference between hardware and software? What are the two phases in writing a program?

  What is the cost in terms of number of seeks

How many blocks of memory are required to achieve this cost in the best case senarous?

  What is the word length required for unambiguous encoding

What is the word length required for unambiguous encoding?- Find the binary code for the sequence abacabb.- Decode the code you obtained to verify that your encoding was correct.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd