In an exam I would use a pen. I have marked many many candidates scripts where they have used pencil, erased it and drawn it again over the top of where they initially did it, but the scanners used are soooo good that they pick up the pencil lines even after rubbing out.
I have attached an example - the right hand C on the left hand structure has how many atoms attached to it? How about the right hand H?. It can go seriously wrong when bonds appear as the line you want to be seen and a second, i.e. double, bond is still visible from the pencil-drawn bond.
So, what should you do? I hear you ask. Do it in pen and if you make a mistake CROSS IT OUT and do it again. And/or write a little message to your examiner explaining what you've done wrong and/or what you meant to put.