U.K. Prime Minister David Cameron said Sunday that he did not think quitting the European Union (EU) was "the right answer" and that the government would "do everything necessary to make it work" if the U.K. voted to leave the bloc. 

Speaking to BBC’s Andrew Marr on "The Andrew Marr Show," Cameron said he was hopeful of renegotiating Britain's relationship with the EU before a referendum scheduled by the end of 2017. Cameron said he was close to securing a deal and that the referendum could be held this summer, but added that it could be delayed if no agreement is reached.

The prime minister also said that if his planned reforms were accepted by the EU, then leaving the bloc would not be the best solution.

The ruling Conservative Party government has drawn up a list of demands for EU leaders, as the price to keep the U.K. inside the trading bloc. The demands include asking the EU to make two “explicit statements:” One that the U.K. will be excluded from any moves toward a European super state, and a second that the euro not be the official currency of the EU.

"Britain joined Europe for trade and cooperation. We do not want to belong to a 'super state',” Cameron said Sunday on the show. The prime minister also said he would not resign if the country voted to leave the EU. 

On being asked if the government was preparing contingency plans in case of an exit, Cameron said that the British civil service was working around the clock to support his negotiation and arrive at a compromise with the EU.

One of Cameron’s key proposals — a four-year freeze on work benefits for EU migrants in U.K. — has met with stiff opposition from EU leaders. However, Cameron said the U.K. would pursue it until an "equally powerful and meaningful" alternative was proposed, BBC reported.

Cameron also said that it was always his intention to allow his party members to campaign against inclusion into the EU in their personal capacity. Many conservative British leaders have expressed concerns over migrants from other countries in the EU taking advantage of the U.K.’s extensive welfare system.

"The Government is not going to be neutral on this issue, with people on one side or the other. My intention is that at the conclusion of the negotiation the Cabinet has a discussion and reaches a clear recommendation to the British people of what we should do," he reportedly said and expressed his hope that the UK "will be staying in a reformed EU."