Program to calculate Percentile of a student based on rank | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; float getPercentile ( int rank , int students ) { float result = float ( students - rank ) / students * 100 ; return result ; } int main ( ) { int your_rank = 805 ; int total_students = 97481 ; cout << getPercentile ( your_rank , total_students ) ; }