To run C code, you need a compiler. A compiler is a tool that turns the .c file you wrote into an executable program the computer can understand. While you're just starting out, an online editor works fine — but once you want to build a real project, it's better to set up GCC or Clang on your local machine.
c
// hello.c
#include <stdio.h>
int main() {
printf("Hello C learner!
");
return 0;
}#include <stdio.h> pulls in the library that lets you use printf(). main() is where the program starts running, and return 0; tells the operating system the program finished successfully.
You should see
Hello C learner!Info
Save the file hello.c with a .c extension. In the terminal, compile it with gcc hello.c -o hello and run it with ./hello.