My First Linux C Program Example- Hello world
Posted on April 27th, 2008 by linux
Here is how you can create linux hello world program. First make sure that you have gcc ( c programming language compiler ) package installed. On debian or on ubuntu you would do:
apt-get install gcc
save this code as linux_program_hello.c
#include
#include
int main()
{
printf("My First Linux Program - Hello World\n");
exit(0);
}
now its compile time:
gcc -o linux_program_hello linux_program_hello.c
run your first c program:
./linux_program_hello
this should produce:
My First Linux Program - Hello World
Filed under: C, Linux, Linux Programming Tutorial, Programming