Global variables are variables that are declared outside a function, meaning that they can be accessed anywhere in the program by any function. Any variable declared outside of int main() is a global variable. Using global variables is not good programming technique, although it can be done.