اینطوری بنویسید:

His final mark was 18 (out of 20) and he ranked in top 5% of my class of 40 students.