</>
CompilerOnline
Open Interactive Editor

Online C Compiler

Introduction to C

C is a procedural programming language. It was initially developed by Dennis Ritchie in the year 1972 at Bell Labs to write operating systems. It forms the foundation for many modern languages like C++, Java, JavaScript, and C#.

C operates close to the hardware, offering direct memory access and a minimal runtime overhead. This makes it the primary language for embedded systems, drivers, and system kernels.

Core Characteristics

  • Low-level memory access via pointers.
  • Highly efficient and compiled code.
  • No built-in garbage collection.

The execution lifecycle of a C program involves pre-processing (handling macros and headers), compilation to assembly, assembling to machine code, and linking system objects into a single executable binary.

Format String Printing

The standard C printf() function uses format specifiers (like %s for strings or %d for integers) to write formatted text to stdout.

c
#include <stdio.h>
int main() {
    char name[20] = "Developer";
    printf("Hello, %s\n", name);
    return 0;
}
c
#include <stdio.h>

int main() {
    printf("Hello from standard C sandbox!\n");
    return 0;
}