Thursday, July 9, 2009

Hey wot's the problem in thi c++ program y can't i get the output?

#include%26lt;iostream.h%26gt;


enum card{club,diamond,heart,spade};


main()


{


cout%26lt;%26lt;diamond%26lt;%26lt;endl;


cout%26lt;%26lt;spade%26lt;%26lt;club%26lt;%26lt;endl;


return 0;


}


i can't get the output. plz help!

Hey wot's the problem in thi c++ program y can't i get the output?
do one thing;





#include%26lt;iostream.h%26gt;


#include%26lt;conio.h%26gt;


enum card{club,diamond,heart,spade}...


void main()


{


cout%26lt;%26lt;diamond%26lt;%26lt;endl;


cout%26lt;%26lt;spade%26lt;%26lt;club%26lt;%26lt;endl;


getch();


}





run like this I have changed the return type of main method and at the end i am using getch(). It will ask for a character input and then u can see the output before entering a char.
Reply:Is the program compiling and you just don't get output? Then do what the others said.





If the program will not compile, you might be missing a "using namespace std;" line after the include statements.
Reply:you need to put in system("pause"); before return 0; otherwise the output thing just flashs quickly and then disappears. hope this helps!


No comments:

Post a Comment