My iphone 4 asks a four digit code which i dont know for resetting

I want to reset all settings,now its asking a four digit code which I and the previous owner don't know...can you please assist me...
Welcome to iMore.

Here is a guide by Apple on how to reset your password. But you will still need the Apple ID and password afterwards.
If you've bought the phone from someone they should have done this before you got the phone.

Ask them to either reset the phone for you or provide you with all the details you need to reset it or refund you if they're stopping you making use of the phone you bought from them
Or you can just return the phone to rightful owner....lol

Original thread: https://forums.imore.com/threads/my-iphone-4-asks-a-four-digit-code-which-i-dont-know-for-resetting.380944/