In most of the questions i see people commenting the answers instead of Answering it in its appropriate place. what is the purpose of having a comment option. i am asking this so users like me can understand more about the difference and there can be a solution to prevent answers as comment.
What are comments?
Comments are temporary "Post-It" notes left on a question or answer. They can be up-voted (but not down-voted) and flagged, but do not generate reputation. There's no revision history, and when they are deleted they're gone for good.
Please note that you can always comment on your own posts, and any part of your questions. However, commenting on other people's posts is a privilege.
Anything that significantly solves the problem posed in the question should be an answer, and answers are the primary focus of the site.
Comments are for things like requests for clarification and generally should not include anything directly relevant to solving the problem--if a comment actually answers the question, it should be fleshed out into an answer (ideally by the original commenter, but if the commenter is long gone feel free to post an answer yourself and reference the comment).
Comments should be expected to be ignored by anyone who isn't asking/answering the question, anyone visiting from Google/etc should see the full story just by reading the question and answers. IN addition comments can be deleted at pretty much any time if they get too cluttersome, off topic etc.