Hello poonamp6792,
The first three line you see on the screen come from your input prompts.
If you do not want these line in your final output there are several options.
First you could re position the cursor to the first line and output over what is there.
Second re position the cursor to the first line and print a long line of spaces to remove what is there, Re position the cursor again then do your final output.
Third make your input prompts look like you final output and use them as input prompts and final output adding the extra line for final output.
Forth you could use a function to clear the screen. I would stay away from anything that starts with "system" as it could leave your program vulnerable to attack. Also trying to clear the screen or re position the cursor is generally tied to the operating system you are using and may not work for everyone.
I use a function to clear the screen, but it is designed for windows. Let me know if you are interested. You could also try reading
http://www.cplusplus.com/forum/beginner/1988/ for some ideas. Or do a search here on "clear screen" and see what comes up. You should find something useful.
As a last note the if statements t lines 23 and 30. If this i what you want I would add a pause before the exit so the user ha a chance to read the message before the program exits and the window closes. And I would suggest for line 26 use "exit(1)" and line 33 use "exit(2)". This will give you the information needed to know which input caused the problem. "exit(0)" can be used, but zero means that the program ended normally which it did not.
Let me know what you would like to do and I will help you figure it out.
Hope that helps,
Andy