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

  For which group is a birth length of 45 cm more common

Find the standardized score (z-score), relative to all U.S. births, for a baby with a birth length of 45 cm.

  Find the percentages of people with different opinions

Using the 1% significance level, test the null hypothesis that the percentages of people with different opinions are similar for all four regions.

  At a food processing plant, a machine produces

At a food processing plant, a machine produces 10 lb bags of sugar. In this particular process, it is important that the sugar content does not go below 9.9 lbs. In fact, when the bags of sugar are less than 9.9 lbs, maintenance is performed..

  Probability-marketing person selected direct sales-sales rep

Pitney Bowes surveyed 302 directors and vice presidents of marketing at large and midsized U.S. companies to determine what they believe is the best vehicle.

  Number of tissues used during a cold

Give the null and alternative hypotheses to determine if the number of tissues used during a cold is less than 60.

  Present value of interest tax shield

Assume the cost of debt is 0.298%(5 years to maturity). Corporate tax rate is 30.89%. What's the present value of interest tax shield?

  Hurricanes and losses

A discussion of extreme weather says, "In most states, hurricanes occur infrequently. Yet, when a hurricane hits, the losses can be catastrophic.

  Hypothesis and hypothesis testing for the mean

Introduction to hypothesis and Hypothesis Testing for the Mean (sigma known)

  Confidence interval for the true mean wing span

What formula should be used to calculate the 90% confidence interval for the true mean wing span of honeybees.

  Determining significance level and p-value

She decided to investigate and gather the following sample information. Would it be reasonable for her to conclude that union nurses earn more? Use the .02 significance level. What is the p value?

  Let x be the number of teams from sd on petes season

a sports league is making up their season schedule. the league has 12 teams with eight teams from la and the rest from

  Compute the expected value of the size of the freshman

the table below gives the size of the freshman class entering bsc for the past several years.class

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