Or atleast thats what I THINK the problem is. Here is the function I am having toubles with.

The idea is that two numbers are entered, and the code should check to see how many numbers in the array are within those two numbers.

The array was sorted from least to highest in a different function. I always end up with the program only returning '1' for the number of students with in the range... which leads me to believe that my logic in the for loops are incorrect.

Any ideas? Attached is the entire program.

Code:void RangeData(int *grades, int numStudents) { int studentNumber; int highRange = 0; int lowRange = 0; int lowRangeReturn = 0; int highRangeReturn = 0; int gradesInRange = 0; char rangeAgain; cout<<"\n\nEnter the low value for a grade range look up: "; cin>>lowRange; cout<<"Enter the high vaule for a grade range look up: "; cin>>highRange; for (studentNumber = 0; lowRange == studentNumber; studentNumber++) { if(lowRange == grades[studentNumber]) { lowRangeReturn = grades[studentNumber]; } }//find low range number for (studentNumber = 0; highRange == studentNumber; studentNumber++) { if(highRange == grades[studentNumber]) { highRangeReturn = grades[studentNumber]; } }//find high range number gradesInRange = (highRangeReturn - lowRangeReturn)+1; cout<<"\nThere are "<<gradesInRange<<" students within that range."<<endl; cout<<"\nWould you like to look up another range? (y/n) "; cin>>rangeAgain; if(rangeAgain == 'y' || rangeAgain == 'Y') { RangeData(grades, numStudents); } else if(rangeAgain == 'n' || rangeAgain == 'N') { return; } }//end RangeData