I m smoker &my serum cholesterol is 240 and triglyceride is 500.Do I need medication or some exercise is enough? If yes, wot medicines should I take?

Don't matter. All that worrying about numbers will do you no good. You better quit smoking!
Bang for your buck! You get the most bang for your buck by quitting smoking, in fact it puts money in your pocket and decreases the risk of heart attack and stroke more than anything else you can do. Next make sure you do not have uncontrolled diabetes causing triglyceride of 500. Drink alcohol in moderation or not at all, get your blood pressure checked and your urine tested for protein. Eat healthy.
Exercise not enough. I think you probably need medicines to lower your cholesterol and triglycerides. I did not see your LDL which is the most important (prob b/o high trig.) your dr has to treat you probably with a combination of one statin (to lower ldl))and Fenofibrate to reduce the triglycerides but these may cause side effects together. So he could try one first then decide if the other is warranted. Stop smoking.