Line B is not executed first, line 9 is executed first
actually the problem is, on running the code :
A character is asked .(user types character and presses enter)
Then the ASCII value gets printed after you press 'Enter key'.
This means line 19 is causing me to press enter and then line 17 is displaying ASCII value.
why so?
Did you try cout.flush();
after line 17?
If you don't want to press enter a second time, don't call "getchar( )".
Wazzak