I need to find the first number that exceeds x[floor(0.8*N)+1], when there is duplicate values within the array. but am unsure how to do this. x refers to an array on integers which have been sorted in ascending order. Help is much appreciated.
void eightypercentile(int x[], values)
{
int eightiethpercentile;
if( x[floor(0.9*N)+1] <= x[floor(0.8*N)])
{
eightiethpercentile = /*first number that exceeds x[floor(0.8*N)+1] */
}
int eightiethpercentile = x[floor(0.8*N)+1];
}