Final answer:
The lifetime of a global variable ends when the program exits. Global variables remain throughout the entire program, making their lifetime longer than that of local variables.
Step-by-step explanation:
The lifetime of a global variable ends when the program exits, which is option C. Global variables are allocated in the program's global scope and remain allocated for the entirety of the program's execution. They are initialized before the main function begins and are destroyed when the program has finished running and is about to exit.
Unlike local variables which are destroyed once their containing function or block scope ends, global variables are accessible throughout the entire program, making their lifetime much longer. This is important to consider in programming because global variables consume resources for the duration of the program and can lead to issues if not managed correctly.