>>anything wrong in the program?
1. its int main().
2. Add return 0; as the last line in main()
3. Add '\n' to the end of Hello, making it "Hello\n"
4. You might need to add fflush(stdout) after that print statement.
If the above doesn't fix the problem then I don't know what's wrong.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
If you write your program like this:
#include <stdio.h>
#include <conio.h>
void main(){
printf("\nHello World !!");
getch();
}
It should work..
deepugtm
Junior Poster in Training
96 posts since Aug 2008
Reputation Points: 2
Solved Threads: 2
I am too new to c programming.I think as the program doesnt return any value you should either put void main,or give return 0 at the end of program.
Just take it as a suggestion not sure if it is tha solution.
alvalany
Junior Poster in Training
61 posts since Jul 2009
Reputation Points: 8
Solved Threads: 2
I am too new to c programming.I think as the program doesnt return any value you should either put void main,
NEVER use void main()
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
> main() or void main() or int main() it worked for me
Understand that there is a difference between the language and a compiler.
The language states that main returns int.
Your compiler (just one of many) is an implementation of that language. All compilers extend the language in some way, for a number of reasons.
Learn the language, and not the compiler.
Or at least learn that there is a difference, so that it is not a total surprise to you when you come to use another compiler.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953