![]() |
Numbers in line
Hi there, I need to write a program that reads up to 10 numbers per line to be stored in an array.The program calculates and displays the sum of the numbers, the mean (arithmetic average) of the numbers, and the largest and smallest values entered for each line.
the input file is 45 98 35 23 67 84 65 91 20 54 62 37 65 84 32 21 54 95 87 35 62 54 78 56 95 62 35 54 78 i have this much so far Code:
#include <iostream>// The output i m getting is 352 58 23 98 510 56 20 98 486 60 20 98 56 56 20 98 324 64 20 98 |
Re: Numbers in line
Initialize nMin and nMax to the first member of the line when you first read it.
|
Re: Numbers in line
Quote:
Thanks Shabbir for the reply, got working by reseting the value of min and max. Thanks again. |
| All times are GMT +5.5. The time now is 11:30. |