An uncharged capacitor and a resistor are connected in series with a switch and a 12 V battery. At the instant the switch is closed, the voltage across the resistor is
Since a capacitor can't change the voltage between its plates instantaneously, this means that just after the switch is closed, the voltage through the capacitor is zero.
So, the current that flows in this moment is the same that would flow in a series circuit with only one resistor connected to the battery.
Applying KVL to the circuit (neglecting the presence of the capacitor which can be replaced by a short circuit just after closing the switch), the voltage through the resistor must be equal to the one of the battery, i.e., 12 V.