Question: Write a for loop that iterates six times to find the maximum value in a list of six floating - point values. Within the loop:
Write a for loop that iterates six times to find the maximum value in a list of six floatingpoint values. Within the loop:
Read a floatingpoint value from input into variable inValue.
The first value assigned to inValue is the largest floatingpoint value read by default, since no other values have been read
yet. Thus, if the current iteration is the first iteration, assign maxVal with inValue.
Otherwise, if inValue is greater than maxVal, assign maxVal with the value of inValue.
Click here for example
Note: All floatingpoint values are of type double.
#include
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
