What are global variables explain with examples?

Answer:
Variables that the program can use everywhere in the program. Example:
int x = 5;

int main(void)
{
x = 6;
foo();

return 0;
}

void foo(void)
{
x = 5;
}
First answer by Imkj. Last edit by Imkj. Contributor trust: 3 [recommend contributor recommended]. Question popularity: 1 [recommend question].