Question 1: Using a loop statement (for/while/do...while), read in five values and store in an array 'Mydata'. Find the highest value. Show how much each value differs from the highest value. int...


Question 1:<br>Using a loop statement (for/while/do...while), read in five values and store in an array 'Mydata'.<br>Find the highest value. Show how much each value differs from the highest value.<br>int main()<br>{<br>double Mydata[5];<br>for (int i=0; i<5; i++)<br>{<br>cout <« >Mydata[i]; } double highest=Mydata[0]; for (int i=0; i<5; i++)="" {="">< "highest="" value="" is="" "="">< highest=""><« endl;="" for="" (int="" i="0;"><5; i++)="" {="" cout="">< "different="" "="">< mydata[i]-highest="">< endl;="" }="" return="" 0;="" }="" "/="">
Extracted text: Question 1: Using a loop statement (for/while/do...while), read in five values and store in an array 'Mydata'. Find the highest value. Show how much each value differs from the highest value. int main() { double Mydata[5]; for (int i=0; i<5; i++)="" {="" cout=""><« "enter="" a="" decimal="" number:="" ";="" cin="">>Mydata[i]; } double highest=Mydata[0]; for (int i=0; i<5; i++)="" {="">< "highest="" value="" is="" "="">< highest=""><« endl;="" for="" (int="" i="0;"><5; i++)="" {="" cout="">< "different="" "="">< mydata[i]-highest="">< endl;="" }="" return="" 0;="">

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here