Question about compiling (noob)

I'm just getting started to lean C and I'm using Ubuntu today I found a tutorial at this site: http://einstein.drexel.edu/courses/CompPhys/General/C\_basics/c_tutorial.html and I got an error after compiling the fist code:

#include < stdio.h>

void main()
{
    printf("\nHello World\n");
}

I try to compile it with: "cc hello.c" and got this error:

arya@arya-computer:~/Desktop$ cc hello.c
hello.c:1:20: error:  stdio.h: No such file or directory
hello.c: In function �main':
hello.c:5: warning: incompatible implicit declaration of built-in function �printf'
hello.c:4: warning: return type of �main' is not �int'

Why isn't this working is it because I'm using Ubuntu instead of FreeBSD?

hi arya
you have to know that it may not have space before stdio.h
just gothrough your code

#include <stdio.h>

void main()
{
printf("\nHello World\n");
}

do this

:frowning:

Now it gives this error

arya@arya-computer:~/Desktop$ cc hello.c
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function �main':
hello.c:5: warning: incompatible implicit declaration of built-in function �printf'

The return type of main should be int, not void. The code below compiled & ran fine on my computer. Does Ubuntu use gcc? ( If so, your version of 'cc' is possibly a link to 'gcc'. ) I'm using gcc and it worked.

#include <stdio.h>

int main()
{
printf("\nHello World\n");
}

same thing when I use gcc, do you think there is something wrong with the compiler? I'm sorry if this sounds stupid, but one of first lines says: hello.c:1:19: error: stdio.h: No such file or directory should there be a file called stdio.h in the same folder as my .c file is?

arya@arya-computer:~/Desktop$ gcc hello.c
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function �main':
hello.c:5: warning: incompatible implicit declaration of built-in function �printf'

change this:

#include < stdio.h>

to this - loose the trailing space after '<'

#include <stdio.h>

Maybe the 'package' containing stdio.h is not installed...

No, usually it is in /usr/include.

k guys, I found the problem, gcc was not installed properly, now it is and now I have a file called a.out after compiling it. How can I run it?

for example ur prog. is like this

int main()
{
printf("hello");
}

save this file as my.c
compile it as cc my.c
then it creats an exe that is a.out
now run this
./a.out
in ur terminal.

this is the process