Quote Originally Posted by vikasvijayan
i wil give you a simple solution for this problem
The good part is that it is not actually a solution, so you are technically not handing out an answer to a homework question before the question asker has come closer to a solution.

On the other hand, it seems that you did intend to give an actual solution. To keep to the spirit of the [url=http://cboard.cprogramming.com/c-programming/announcement-homework.html]homework policy, please do not do others homework. Normally, this rule is more for question askers than help providers, but you have basically tried to provide solution, however incompetently, for many of your past posts, so consider this an unofficial warning.

Oh, and void main should be int main.