First you need the library include for printf.
You also put /n instead of \n
So the solution is:
#include
main()
{
printf("hello, world\n");
}
2006-10-18 10:19:35
·
answer #1
·
answered by juliepelletier 7
·
0⤊
1⤋
All answers above may still not work. Jullie has the closest right answer.
Cut and paste this code:
#include
int main(void)
{
printf("hello, world\n");
return 0;
}
Good luck,
Avi
2006-10-18 17:24:20
·
answer #2
·
answered by Dr_maayan 1
·
0⤊
0⤋
I took a course and I did the same thing; I took examples straight from the book and they wouldn't compile. I think it was the program I had for compiling. I never found out because I didn't get another compiler.
One quick note...
Semi colons are big in programming. Make sure you have them in the right places and always have them in places that need them.
2006-10-18 17:12:03
·
answer #3
·
answered by tomasdogg 2
·
0⤊
2⤋
Can you please give more details, like what are the errors/warnings the compiler is giving.
The immediate issues I can see from your code,is you need to declare the header file(#include ) as you are using printf() stmt.
Some compilers may expect the return value parameter before main(), as you are not using the return stmt. at the then end of the main() block, you can use void main().
2006-10-18 17:10:53
·
answer #4
·
answered by junkjaan 1
·
0⤊
2⤋
Change the parens to french curly brackets! I think, been a long time since I did C programming.
main()
{
printf("hello, world/n");
}
Haha! See how much I know. Listen to them.
2006-10-18 17:09:55
·
answer #5
·
answered by Special Ed 5
·
2⤊
1⤋
I don't know much about C, but try it like this:
#include
void main()
{
printf("\nHello World\n");
}
I think you need the include at the top.
2006-10-18 17:38:51
·
answer #6
·
answered by linuxfortravelers 3
·
0⤊
0⤋
main
{
printf("hello, world \n");
}
Remember the braces and the \n.
You'll probably have to #include the standard I) library.
2006-10-18 17:14:12
·
answer #7
·
answered by Deirdre H 7
·
0⤊
2⤋
try putting the quotes .. world"/n) if that doesn't work, you might need to include a library file. look in the book for the right file you would need.
2006-10-18 17:09:02
·
answer #8
·
answered by rchilly2000 5
·
0⤊
2⤋
try this
int main()
{
printf("hello, world\n");
return 0;
}
2006-10-18 17:11:05
·
answer #9
·
answered by JohnDoe 1
·
0⤊
2⤋
Is that all you've written, or are there headers?
Rawlyn.
2006-10-18 17:11:50
·
answer #10
·
answered by Anonymous
·
0⤊
3⤋