Thanks......
but isnt %d,%f etc... written in c language.

I have written the program in C++ (sorry i forgot to mention it in the earlier post)