The AM array has a code that represents each student
and Temp array has the average value of 6 lessons for each student
Swap function swaps 2 double variables
FindMO function finds the average value of each collumn of array B and uses a temporary array (temp) to save the average values of each collumn. Then it sorts in decreasing order the temp and AM arrays and prints them.
When i try to run the code it comes up with the following message: fault floating point invalid operation. and it prompts me to line 26.
I believe it is because your argument arrays are not entirely filled with proper floating point values.
Trying to compare, for example, 1.7 to NAN (Not A Number) will produce a fault. Make sure you completely initialize the arrays you pass as argument to FindMO() to a valid number, like 0.0 or -1.0 or etc.
If that isn't the problem, you'll have to post a little more code.
That must be it. The program is supposed to read the values from a .txt file which has no more than 150 (lines). but the sum of the values is unknown.
I wrote to a text just 6 lines to test my program but I save values to an array of 150 positions. the program puts "garbage" in the arrays after the 6th entry to the array. I'll check it and come back and post.
cheers