c how to include variables of other c file

// File: main.c

#include <stdio.h>

// Declare the variable from another file
extern int sharedVariable;

int main() {
    // Access the variable from the other file
    printf("The value of sharedVariable is: %d\n", sharedVariable);

    return 0;
}
// File: otherFile.c

// Define the variable to be shared
int sharedVariable = 10;