With the same logic, you can acquire motivation in classroom. If you take up a subject of your interest, then do not think about success or failure, just study because you like it, because you want to get knowledge. If you work or study to learn more, you are sure to excel, and then the reward and success is sure to follow.