It all depends on which virus you get and also on how you do the system reset.
In short, some viruses will hide in the boot sector of your hard drive - and most formatting won't catch this.
Many system resets will wipe the hard drive clean - but not all.
The safest thing to do is to have a set of system recovery disks.
Then use DBAN or KillDisk (both are free) to completely wipe the drive clean.
Then use the system recovery disks to reset the computer to the way it was when it left the factory.