Question: Write a C program named sort.c . The program should include a function named selection _ sort ( ) . selection _ sort should take
Write a C program named sort.c The program should include a function named selectionsort selectionsort should take two arguments: the first argument should be an int array and the second argument should be an int representing the array size. The function should return void. It should sort the input array using the selection sort algorithm.
Your main method should demonstrate that your selectionsort function works on several input arrays for example, by printing the array before and after the sort
Ensure that your submitted selectionsort function does not print anything print only in main or helper functions called in main
Write a C program named rainfall.c The program should prompt the user to enter daily rainfall totals, one per line, until they enter The program should also accept the value T for a "trace" negligible amount of rainfall. After the user enters the values, the program should print the total rainfall with two digits to the right of the decimal point. Count T as You can assume that the input rainfall totals will be a nonnegative int or float with a value less than and with no more than two digits to the right of the decimal point or T or You must use getchar not functions such as scanf or getint that we haven't seen yet. Your rainfall.c file should not depend on any other files. An example run is shown below user input is in quotations:
b$ gcc rainfall.c
$ aout"
Enter daily rainfall totals, one per line, use T for trace, use to quit:
T
Total rainfall:
Hint: the function atof is similar to atoi but returns a double instead of an int. It is included in stdlib.h You can look up this function and use it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
