Programming Exercises
Some users might be daunted by being asked to enter an EOF character. Modify getarray() so that a # character terminates input the first time it is entered.
Create a program that sorts float numbers in increasing order.
Modify the sort() function in Listing 13.12 so that it uses the suggestion given in the "Comments" section following the sample output; namely, that the function keep track of the index of the largest value and swap values only after the inner loop terminates.
Write and test in a loop a function that returns the number of times it has been called.
Write a program that generates a list of 100 random numbers in the range 1–10 in sorted decreasing order.
Write a program that generates 1,000 random numbers in the ...
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.