# Code::Blocks Program Console



## balanga (Dec 5, 2017)

I'm trying to use Code::Blocks for the first time and trying to run the 'Hello, World!' program.

Is there  any way to make the Program Console to stay open until I close it as it seems to pop open momentarily and then disappear.


----------



## xavi (Dec 6, 2017)

balanga said:


> Is there  any way to make the Program Console to stay open until I close it as it seems to pop open momentarily and then disappear.



Yes, you need to add a call to the getchar() function after the initial output of 'Hello, World!'. The code should look like this:


```
#include <stdio.h>

int main()
{
  printf("Hello World\n");
  getchar();
  return 0;
}
```


----------



## balanga (Dec 6, 2017)

Thanks for that. It seems like a bit of a kludge, and I would have expected that there would be some option to do this through the User Interface... The number of options is intimidating especially for somone using it for the first time. Maybe I didn't find such an option if there isn't one...


----------

