Write a program to sort numbers

Assignment Help Basic Statistics
Reference no: EM132757614

C programing

Write a program to sort numbers in either descending or ascending order. The program should ask the user to enter positive integer numbers one at a time(hiting the enter key after each one) The last number entered by the user should be -1, to indicate no further numbers will be entered. Store the numbers in an array, and then ask the user how to sort the numbers (either descending or ascending). Call a function void sortnumbers ( int numbers[ ], int size, int ascending ) to sort the numbers. Size is the total number of numbers entered. If the argument ascending is 1, the numbers should be sorted in ascending order, if it is 0, the numbers should be sorted in descending order. The sortedNumbers function should call a swap numbers should be sorted in decending order. The sortednumbers function should call a swap function, which will swap the contents of two array elements. Lastly, display the sorted numbers.

Reference no: EM132757614

Questions Cloud

Explain the rationale of the design : In practice, I/O schedulers favor synchronous request over asynchronous request. Explain the rationale of the design?
Effect of anticipatory scheduling : [I/O Scheduling]. The effect of anticipatory scheduling is neutralized if prefetching is enabled and processes are doing sequential acces. Please Explain why?
Explain seek-optimized disk scheduling : The mClock algorithm may be at odds with seek-optimized disk scheduling. Please explain why there is such a conflict and propose a solution?
Find out the day of the week for the latest flightdate : Find out the day of the week for the Latest FlightDate and store it in a variable.
Write a program to sort numbers : Write a program to sort numbers in either descending or ascending order. The program should ask the user to enter positive integer numbers
Example of modular exponential algorithms : Example of Modular exponential Algorithms hat tells how the function formed? (step by step explanation)
What is the most popular server programming language : What is the most popular server programming language? Can you find which web application or online systems are programmed with PHP?
What are single-magnetic recording drives : What are Single-Magnetic Recording (SMR) drives? Why it is difficult to handle random writes in SMR drives?
Modern ssds support a new feature called multi-stream : Modern SSds support a new feature called Multi-Stream Writing. Demonstrate how this feature benefits garbage collection using example.

Reviews

Write a Review

Basic Statistics Questions & Answers

  Statistics-probability assignment

MATH1550H: Assignment:  Question:  A word is selected at random from the following poem of Persian poet and mathematician Omar Khayyam (1048-1131), translated by English poet Edward Fitzgerald (1808-1883). Find the expected value of the length of th..

  What is the least number

MATH1550H: Assignment:  Question:     what is the least number of applicants that should be interviewed so as to have at least 50% chance of finding one such secretary?

  Determine the value of k

MATH1550H: Assignment:  Question:     Experience shows that X, the number of customers entering a post office during any period of time t, is a random variable the probability mass function of which is of the form

  What is the probability

MATH1550H: Assignment:Questions: (Genetics) What is the probability that at most two of the offspring are aa?

  Binomial distributions

MATH1550H: Assignment:  Questions:  Let’s assume the department of Mathematics of Trent University has 11 faculty members. For i = 0; 1; 2; 3; find pi, the probability that i of them were born on Canada Day using the binomial distributions.

  Caselet on mcdonald’s vs. burger king - waiting time

Caselet on McDonald’s vs. Burger King - Waiting time

  Generate descriptive statistics

Generate descriptive statistics. Create a stem-and-leaf plot of the data and box plot of the data.

  Sampling variability and standard error

Problems on Sampling Variability and Standard Error and Confidence Intervals

  Estimate the population mean

Estimate the population mean

  Conduct a marketing experiment

Conduct a marketing experiment in which students are to taste one of two different brands of soft drink

  Find out the probability

Find out the probability

  Linear programming models

LINEAR PROGRAMMING MODELS

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