The president and chief officer of the Great Atlantic & Pacific Tea Co., Inc. resigned yesterday, halfway through the five-year recovery plan he helped design for the troubled but improved food giant.

Grant C. Gnetry, 53, joined A&P in March 1975, and along with its chairman Jonathan Scott, who had taken that post only a month earlier, the two embarked on a rebuilding program for the company, which had lost its No.1 position to Safeway in 1973.

In 1974, A&P showed a net loss of more than $157 million. Since it controversial five-year recovery plan began in 1975. A&P has closed 1,600 stored and reduced its work force by 16,00 people.

The profit has been improving with a $4 million gain in 1975 and a $23 million profit last year. But chairman Scott already has predicted that this year's fiscal picture will not be as bright as in 1976.

Still, industry sources were taken by surprise when the resignation was announced. Although it is acknowledged that A&P had a long way to go, sources said the company had made sources said the company had made major improvements in the past two years.

In a statement distributed to employees at A&P headquarters in Montvale, N.J. yesterday morning. Gentry said he was leaving "of my own initiative with mixed emotions . . . and I will moss the friendships I have made here."

The Chicago-born Gentry said he would be going into the management consulting business, but gave no details.

A&P spokesman Dan Doherty said Gentry will be replaced by David W.Morrow, 46, who joined A&P as VIce chairman and chief operating officer last year, after a long stint at Albertsons, another chain.

Morrow had previously worked under A&P chairman Scott when both were at ALbertsons.

Doherty said Gentry's departure was a surprise to everyone, and "it really isn't hard to understand if you know Grant Gentry. When he decides he wants to do something, he just does it, "Dolherty said Gentry and Scott "were getting along just fine."

Scott accepted Gentry's resignation "with regret," saying, "he has helped A&P immensely since joining the company at the start of our redeveopment program."

Until the five-year plan began. A&P had no training programs, no proto-type stores that could be used as models for future stores and had made few concessions to automation. At present the firm is involved in such ventures as in-store banking and other automation experiments in Atlanta and Chicago.

But A&P is now in danger of falling into the third spot, behind Kroger, which has been outperformed both of its larger competitors recently.

Last year, Safeway had sales of $10.4 billion, A&P $7.2 billion and Kroger $6.1 billiob, according to Chain Store Age magazine.

In recent front page analysis. Supermarket News, another trade publication, stated, "If recent sales trends for Kroger will be in a strong position to surpass A&P and become the number two chain in the country sometime next year."

In their quartely report filed last month, A&P said its first half-year earnings for 1977 were $7.9 million, compared with $17 million for the same period a year ago. Sales during the 1977 period were up slightly from 1976.

The quarterly picture was worse, with the most recent quarter of 1977 showing a $1.2 million a year ago in the same period.