The nation's major cities experienced a sharp upsurge over the past year in requests for emergency shelter and food by the homeless and the hungry, the U.S. Conference of Mayors reported yesterday.

Requests by the homeless for emergency shelter increased an average of 24 percent over the past year for a sample of 30 major cities as the economy lagged, the conference said, while requests by the hungry for emergency food aid were up 22 percent.

Boston Mayor Raymond L. Flynn (D), co-chair of the Conference of Mayors' task force on hunger and homelessness, outlining the findings at a news conference yesterday, said that while "things are bad and are getting worse" in the economy, the problem also is the cumulative impact of "years of neglect" of the homeless and the hungry by the federal and state governments and federal failure to fund new low-income housing.

He said that because states did not finance community services to assist the half-million people they pushed out of mental hospitals, many of the former patients are ending up on the street.

The Reagan administration, Flynn said, slashed federal funds to build low-income assisted housing from about $35 billion in budget authority annually a decade ago to about $7 billion in 1989 and sharply cut back a wide range of grants to the cities to help the needy.

"Officials in all but one of the cities said lack of housing affordable for low-income people was the chief cause of homelessness," said Charlotte, N.C., Mayor Sue Myrick (R), co-chair of the hunger and homelessness task force.

"Lack of services for the mentally ill and for substance abusers, and high levels of unemployment and underemployment, were also seen as contributing factors in most of the cities," Myrick said.

Flynn and Myrick said a disquieting development is that public sympathy seems to be turning against the homeless. "Many people are becoming less tolerant, less patient with the people on the streets," said Myrick, who added that there are an estimated 600,000 to 3 million homeless Americans.

Underscoring the mayors' comments, the National Coalition for the Homeless, in a related report, said the growing scarcity of low-cost housing is a principal reason for homelessness.

It said it is a generally accepted principle that a family should be able to rent housing for no more than 30 percent of its income.

There are 8.6 million U.S. families with incomes of $9,700 or less, the coalition said, which means their top rental should not exceed about $2,900 a year. But there are only 4 million rental units available for that amount or less, according to coalition figures.

Looking at hunger, the mayors' survey found that all but a handful of cities registered an increase in food requests, with the average city experiencing a 22 percent increase. It said, "Employment-related problems led the list of causes of hunger."

Looking at homelessness, the survey found that 80 percent of the cities registered an increase in requests for shelter. The average for the 30 cities was a 24 percent increase.

"On average, the composition of the survey cities' homeless population is 51 percent single men, 34 percent families with children, 12 percent single women and 3 percent unaccompanied youth," the survey said.

"An average of 28 percent of the homeless population in the cities are mentally ill; 38 percent are substance abusers; and 6 percent have AIDS or HIV-related illness. An average of 24 percent of the homeless population are employed in full or part-time jobs; 26 percent are veterans" of military service, the survey added.

Locally, summary tables showed that Alexandria reported a 32 percent increase in requests for shelter and a 17 percent increase in demands for emergency food, with some being turned away. The tables included no information on those two categories for the District.