my pc don't show display when i exit my c language program.plz tel me how can i correct it

Recommended Answers

All 2 Replies

You're going to have to be a bit more specific. What display are you talking about? By "my C language program" do you mean your IDE or some code you have written?

You need to either run your program from the command prompt, or put some form of pause at the end of your program.

For example:

#include <iostream>
#include <limits>
using namespace std;

int main()
  {
  // This is my program
  cout << "Hello world!\n\n\n";

  // This keeps the console window open on Windows.
  cout << "Press ENTER to quit." << flush;
  cin.ignore( numeric_limits <streamsize> ::max(), '\n' );

  return 0;
  }

Personally, I recommend you get used to using the command prompt when working with console programs. On Windows, you can get to the command prompt by clicking Start, Run..., and typing "cmd". Then use the "cd" command to change to the directory where you compiled your program. Then type the name of your program and see it go.

Hope this helps.

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.