Final answer:
In the given program, 'a' and 'b' are of the automatic storage class, while 'counter' is static.
Step-by-step explanation:
In the program snippet that you've provided, the variables a and b are of the automatic storage class, whereas the variable named counter is declared with the static storage class. In C, variables that are declared inside a function without any storage class specifier are by default considered automatic (auto). This means they are automatically created when the function they are inside of is called, and destroyed when the function exits. The keyword static, however, indicates that the variable's lifetime is the entire execution of the program, so it's not automatic.