Program to calculate Percentile of a student based on rank | Program to calculate the percentile ; flat variable to store the result ; calculate and return the percentile ; Driver Code
function getPercentile ( rank , students ) { var result = ( students - rank ) / students * 100 ; return result ; } var your_rank = 805 ; var total_students = 97481 ; document . write ( getPercentile ( your_rank , total_students ) . toFixed ( 4 ) ) ;