Question: In C code please, Your task is to write program that reads a sequence of floating-point numbers and prints the mini- mal and maximal elements
In C code please,

Your task is to write program that reads a sequence of floating-point numbers and prints the mini- mal and maximal elements of that sequence. You must use the type 'double' for the floating-point numberS. Input and Output The first line of input to the program will contain the length of the array. You program should check this number and make sure that it is greater than 0, otherwise, it should exit with no message printed. After reading this number n, the program should expect in the input n floating-point num- bers, for which you should use type double. The numbers will be separated by some whitespace such as space characters, newlines and similar. After reading such list of numbers the program must produce a line of output that will look as follows Min: a Max: b where a is the minimum and b is maximum of the given numbers, printed with exactly 4 decimal digits of precision (rounded) After this, the program must read the next number n, which is the length of the next sequence of numbers, and so on. The program will stop when n is zero or less than zero. You can assume that the program is always provided valid input. Sample input and output are given below: Sample Input Sample Output Min: -12.1000 Max: 165.3500 165.35 76-12.1 Mi -1.0000 Max: 200.1200 3 200.12 Sample Output, with visualized whitespace Min:-12.1000 Max:165.3500 Min:_-1.0000Max: 200.120 0 is a space, and is a newline character
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
