Online C compiler
Compile and run C online free, no sign-up: write a C program, feed it input on stdin and get the output, compiler errors and run time in your browser.
How do I run C code online?
This is an online C compiler: write a program with int main(void), put its input in the Input box and press Run. It is compiled on the server and run once, and you see its output, the compiler's errors and warnings, and the run time — free, with no sign-up.
How it works
- Write your program. Start from int main(void), include <stdio.h> for input and output, <string.h> for strings and <stdlib.h> for malloc and atoi, and return 0 at the end.
- Give it input. scanf("%d", &n) reads a number — note the &, since scanf needs the variable's address. fgets(buf, sizeof buf, stdin) reads a whole line safely, newline included; strip it with buf[strcspn(buf, "\n")] = '\0';. Put every line the program reads in the Input box before you run it.
- Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.
Who it is for
Anyone writing C who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying C before setting it up.