Can we see the output of program at dos prompt

kabirk007's Avatar, Join Date: Dec 2008
Light Poster
hi everybody,

anybody can tell me the way , how can i check my 'c' program output at dos prompt

plz. confirm this ASAP.

thanks
Amit
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
What compiler you are using because running the program should show you the output
0
neo_vi's Avatar, Join Date: Feb 2008
Invasive contributor
if u cannot see the output jus add a line in the end of the program
Code:
getch();
If it returns any error include the conio.h header at the beginning
0
skp819's Avatar
Contributor
write the getch(); at the end of the program.
getch(); is used for get one character from the user.
by doing that after execution of the program it will hold the screen and when you press any key then it will go to source code.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
It depends why you can't see the output already. Does the window appear briefly then disappear before you get a chance to look at it? If so prompting for input as the last thing is one solution; running the EXE from a command prompt opened at the right place is another.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Just a silly question. Are you aware of printf / cout functions to display output.