Only if you work hard can you pass the exam.
As long as you work hard,you'll (be able to) pass the exam.