This question was asked in Laws of Refraction
Refrective index questions explain 
Ritam Arora's image