I have a program that creates an array and prompts for ints to fill the array. Then my program determines how many ints were entered, what the min and max are and calculates the average.
Now what I need to be able to do is determine if any of the values entered are higher than the average and if so, print the index number and the value stored there.
Here is the bit of code I have so far:
The output I am getting now is usually "Index 0 value 323546786" or some crazy number which is not even close to any of the test ints I enter.Code:for (i = 0; i < max_input; i++) { if (nums[input] > avg) cout << endl << "Index " << i << " value " << nums[input] << endl; return(0); }
Brian