This is permissible for necessity.

My exam is starting at 12 noon and end at 3 pm. Dhuhr is around 1pm.  Am I allowed to skip salah because I am doing exam and pray immediately after the exam? Asr time is 4pm.

Prayer |