Companion source, header and data files open as tabs above the Monaco editor with syntax highlighting by extension. Extra C, C++, Java, C#, Go, Kotlin, Scala, Swift and Haskell source files compile and link together.

#include <stdio.h>
#include "math_utils.h"

int main(void)
{
    int x = 6;
    printf("square(%d) = %d\n", x, square(x));
    return 0;
}

#ifndef MATH_UTILS_H
#define MATH_UTILS_H
int square(int x);
#endif
#include "math_utils.h"

int square(int x)
{
    return x * x;
}
Student
  1. Click the math_utils.h and math_utils.c tabs above the editor to inspect and edit them, then click Run.
Teacher
  1. Attach up to 5 files (up to 64 KB each) in the CodeLab dialog or in a quiz question.