@@laserlight,@@Matticus ,@@Salem,@@phantomotap
Thanks for your help.
I have now sorted it out.
But today i learnt something about "scanf" which i did not know earlier.
Once again thanks for taking time and explaining everything.

Thank You.