Hello guys,

I m very much new on C. Need all of your help to improve. Right now I m getting one problem. I m writing the very basic program..

#include <stdio.h>

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

When I complie it is showing success. But when I Run this program its not showing me the dos screen properly. Just for a flash the dos screen coming and going off. Not getting the solution. Please help

John

#include <stdio.h>

int main() {
  printf("Hello World!\n");
  getchar(); /* waits until user enters a key if the standard input buffer doesn't contain any */
  return 0;
}
Comments
amazing :-D

By the way blrjohn, you could also try and fire up a console and execute your program from there. It won't disappear then. I dunno on which OS you are, but guessing it's Windows (80% market share or something eh):

Go to:

Start -> Run

type in "cmd"

Hit enter.

Behold the almighty black screen with often blinking cursor! :D

Typing in "cd" and then a path will let you change your directory. Type in "help" if you're in need of more help. Mastering the console is pretty convenient for developers.

Comments
This is how it should be done.

u can see ur result by pressing ctrl+f5 or u can see ur result by adding a simple "getch();"
in ur code...........................

Comments
tk ur sms spk n gtfo

u can see ur result by pressing ctrl+f5 or u can see ur result by adding a simple "getch();"
in ur code...........................

Do you think every one in the world uses the same copiler/IDE that you use?
Your suggestions are not an improvement upon what it has been discussed already.

Welcome to the forum.
Avoid chat rooms speaking format next time you post. We can afford full words in English. There's not restriction about saving bits over here.

Comments
Well said, totally right about that.
This article has been dead for over six months. Start a new discussion instead.