It depends on how you perform it. If you only erase cache memory and user data, the factory reset will not unroot your phone. However, if the factory reset involves erasing system files and downloading again, it will unroot your device.