1、首先创建一个helloworld.c的源文件程序。

代码部分我们就用最简单的helloworld实验。
#include <stdio.h>
int main()
{
printf("Hello, World!\n");
return 0;
}2、打开终端,进入到文件所在的目录用gcc helloworld.c编译程序。
gcc helloworld.c
编译之后我们发现文件夹里面多了,a.out这个程序。

通过./a.out helloworld.c命令来运行程序。
./a.out helloworld.c

此时我们看到Hello,world!已经输出了!