If i take my iphone 4 to the apple store will they restore it?

My friend gave me their old iphone 4 and its not on any carrier but they forgot the passcode. And i can't do anything with it unless i restore it

It would just need to be wiped. If you don't know the icloud password to it though, then they won't do anything with it.

Yes they will

I do not know?

They will have to because they will have to sell it to someone