after i give the input
the screen disappears
all the commands are correct
even then it only takes input
how i can see outputs??

Member Avatar for GreenDay2001

Use you command promt and run. Or if you want to run it directly add std::cin.get() at the end of main() to wait for a keystroke. However this wont work under certain circumstances as mentioned here.

>how to display result in C

Hi you can use
int main()
{
int x=1;
printf( "% d ", x );
getchar(); /*or you can use system("pause");*/
}

Use you command promt and run. Or if you want to run it directly add std::cin.get() at the end of main() to wait for a keystroke. However this wont work under certain circumstances as mentioned here.

Actually, wait for an ENTER :icon_wink:

Was that first post meant to be a Haiku or something ;)

More like a non-rhyming limerick -- 5 lines :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.