How do I arrange the code to have the output (number of right answers) in increasing order instead of decreasing order
/*THIS PROGRAM WILL SCAN EACH OF THE STUDENT'S GRADE BASED ON THE ASWER SHEET AND THE
QUESTIONS KEY. IT WILL THEN, SORT EACH OF THE GRADES BASED ON THE HIGHEST NUMBER OF
RIGHT ANSWERS*/
#include <iostream>
#include <iomanip>
#include <conio.h>
using namespace std;
const int numbStudents = 20;
const int numbQuestions = 10;
int main()
{
cout << "\n\n\n";
cout << "\tTHIS PROGRAM WILL SCAN EACH OF THE STUDENT'S GRADE BASED ON THE\n";
cout << "\tASWER SHEET AND THE QUESTIONS KEY. IT WILL THEN, SORT EACH OF\n";
cout << "\tTHE GRADES BASED ON THE HIGHEST NUMBER OF RIGHT ANSWERS\n\n";
//Students' answers to the questions
char answers[numbStudents][numbQuestions] =
{
{'A','B','A','C','C','D','E','E','A','D'},
{'D','B','A','B','C','A','E','E','A','D'},
{'E','D','D','A','C','B','E','E','A','D'},
{'C','B','A','E','D','C','E','E','A','D'},
{'A','B','D','C','C','D','E','E','A','D'},
{'B','B','E','C','C','D','E','E','A','D'},
{'B','B','A','C','C','D','E','E','A','D'},
{'E','B','E','C','C','D','E','E','A','D'},
{'C','B','D','C','C','D','A','E','A','D'},
{'D','D','D','A','C','B','E','E','A','D'},
{'C','B','D','E','D','C','E','E','A','D'},
{'D','B','D','C','C','D','E','E','A','D'},
{'D','B','D','C','C','D','A','E','A','D'},
};
int studentsMarktemp[numbStudents];
//Key to the questions
char keys[] = {'D','B','D','C','C','D','A','E','A','D'};
//Grade all answers
for (int i = 0; i < numbStudents; i++)
{
//Grade one student
int correctCount = 0;
for (int j = 0; j < numbQuestions; j++)
{
if (answers[i][j] == keys[j])
correctCount++;
}
studentsMarktemp[i] = correctCount;
}
int temp = 0;
int k = 0;
int max = 10;
while (k !=13)
{
temp = 0;
max = studentsMarktemp[20];
for (int j = 0; j < numbStudents; j++)
{
if ((max < studentsMarktemp[j]))
{
//j + max;
max = studentsMarktemp[j];
temp = j;