C online compiler

Real Clang 22 compiler (C23), compiled to WebAssembly. Runs in your browser.

Learn C →
main.c
// Online C compiler: real Clang 22 (C23), running in your browser.
// Press Run (or Ctrl/⌘ + Enter). Text in the Input box below is what scanf reads.
#include <stdio.h>
#include <string.h>

typedef struct {
    char name[16];
    int score;
} Player;

int main(void) {
    Player team[] = {{"Asha", 91}, {"Ravi", 78}, {"Priya", 85}};
    int n = sizeof team / sizeof team[0];

    int best = 0;
    for (int i = 1; i < n; i++)
        if (team[i].score > team[best].score) best = i;
    printf("Top scorer: %s with %d\n", team[best].name, team[best].score);

    int a, b;
    if (scanf("%d %d", &a, &b) == 2)
        printf("%d + %d = %d\n", a, b, a + b);
    else
        printf("Type two numbers in the Input box to add them.\n");
    return 0;
}
Output

Press ▶ Run or Ctrl/⌘ + Enter to run your code.

Programs are compiled for 32-bit WebAssembly, so long and pointers are 4 bytes (on a 64-bit PC they are 8). Each run starts with an empty file system.