This is just one of those things that happens. Unless of course you deliberately go out and french kiss a girl with the flu-like symptoms that you currently have.
But barring that sort of recklessness you are probably ill because fate handed you a dodgy card. This, depending on the exam itself, and the severity of the disease can be either good or bad.
For example, imagine that the illness took a while to gain full strength, the symptoms are there but weak, and only after a while are you considered ill enough to be called sick. This means that the work you were doing the preceding weeks was probably not up to your usual standard and you are screwed when you come to the exam. This is particularly evil if it happens that you are officially ill just after a big exam. Knowing full well that you were ill before, you valiantly and selflessly struggled with the finer points of advanced- hyperdimensional-heiroglyphical-meta-mathematics through blurry eyes, blocked nose, and fuzzy brain. And the sickening thing (pun intended) is that you have no evidence after a couple of days since the disease - once it has done it's evil work - promptly disappears!
Of course this could all be psychosomatic. After all if you ONLY get ill around exam time, people are bound to notice something is up. Maybe the stress of the exams is causing you to become ill by supressing your immune system? Maybe you are depressed cos it's all sunny out there and everyone is having fun, except you? It's all valid. For this reason, it's probably best to see a doctor, take lots of breaks for relaxation (remember you're brain needs time to absorb and sort out what it has learned every 30 mins or so anyway), and also take lots of vitamin supplements. Other advice is of course to avoid caffeine unless you really REALLY need it, as it messes up most people's sleep cycles, albeit slightly and temporarily.
Do not resist the disease.
Let it run its course, doing what is appropriate. The more you fight it the more stressed you are going to be, and the less well off you will feel.
Other than that I wish you luck. I know I will need it this time around, being particularly ill at the moment...