As a native English speaker I was surprised that "You need both to work and have fun" was not accepted, as this is grammatically correct English and is probably the phrasing most native speakers would use. Please add to accepted answers.
(Also a native speaker) for maximum precision one should probably make the construction parallel, and make it "You need both to work and to have fun." But I do agree that in speech your suggestion would be the most likely phrasing, and should be accepted. Please report it.
The sentence seems to be a general sentence using for every body and because of this expresion i translated as "learning and having fun are both needed . "And was marked roung .would some one make it clear .thanks in advanc .