Given the rank of a student and the total number of students appearing in an examination, the task is to find the percentile of the student.
The percentile of a student is the % of the number of students having marks less than him/her.
Input: Rank: 805, Total Number of Students Appeared: 97481
((97481 – 805) / 97481) * 100 = 99.17
Input: Rank: 65, Total Number of Students Appeared: 100
((100 – 65) / 100) * 100 = 35
The formula to calculate the percentile when the rank of the student and the total number of students appeared is given is:
((Total Students – Rank) / Total Students) * 100
Below is the implementation of the above formula:
- Time Complexity: In the above approach, we are able to calculate percentile using a formula in constant time, so the time complexity is O(1).
- Auxiliary Space Complexity: In the above approach, we are not using any extra space apart from a few constant size variables, so Auxiliary space complexity is O(1).
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to calculate Percentile of Students
- Calculate the CGPA and CGPA % of marks obtained by a Student in N subjects
- Program for Rank of Matrix
- Program for Spearman's Rank Correlation
- Program to find Circuit Rank of an Undirected Graph
- C program to calculate the value of nPr
- Program to calculate value of nCr
- Program to calculate age
- Program to calculate the value of nCr Efficiently
- Efficient program to calculate e^x
- Program to Calculate e^x by Recursion
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Write a program to calculate pow(x,n)
- Program to calculate Area Of Octagon
- Program to calculate distance between two points
- Program to calculate distance between two points in 3 D
- Program to calculate the area of Kite
- Program to calculate Root Mean Square
- Program to calculate volume of Ellipsoid
- Program to calculate Electricity Bill
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.