Dear student,
We can connect the galvanometer to any one of the sources using a key in the circuit. If the galvanometer shows definite deflection in a given direction, the source taken is DC source. If the given source is AC source, the average deflection shown by the galvanometer will be zero.
Regards