Open any editor like vi and create a file "hello.c" and write a simple hello world program.
To create a file in using VI editor.
Open Terminal window then type following command to create a file.
vi hello.c
Now press the insert key and type the following program.
#include<stdio.h>
int main()
{
printf("hello world");
return 1;
}
now press type following command to save and exit
:wq
To Compile type the following command
cc hello.c -o hello
To run type the following command
./hello
No comments:
Post a Comment