United Airlines' shareholders were warned today that second-quarter profits will be "severely affected" by the machinists union strike against the nation's largest domestic airline, now in its 27th day.

The warning from Edward C. Carlson, chairman of UAL inc., United's parent company, followed announcement at the corporation's annual meeting here that United had a first quarter loss of $2.3 million, compared with earnings of $13.5 million in the first quarter of 1978.

Although officials refused to comment specifically about the financial impact of the strike - estimated by some to be between $1.5 and $2 million a day - Richard J. Ferris, United's chairman, said that a strike, besides being "devastating" to the public and the company's 54,000 employes, "certainly is costly to an airline."

"An airlines when it ceases to fly ceases to take in revenues," he said.

Although United has canceled all flights through May 5 and currently is taking reservations for flights only for June 7 and beyond, Ferris expressed confidence that the airline would try to return to full operation within four or five days of any settlement with the International Association of Machinists, which shut down the airline at midnight Friday, March 30. The strike was called after the rank-and-file rejected the second of two proposed settlements worked out in negotiations with the company.

In his first public statements about the strike since it started. Ferris said talks have been going on with the union under the auspices of a federal mediator in Denver since Monday. "At this time, I have nothing to report except that we are prepared to continue talking in the hope of reaching a settlements," he said.

Ferris defended United's decision to break off negotiations on April 4 - the first attempt at talks after the strike - when the union presented, though a mediator, a package that would have added more than $100 million to the amount of the second proposed agreement. That second tentative agreement would have provided for pay increases of about 32 percent plus improvements in vacations, insurance, pension, and working hours over three years, Ferris said, for a total cost to the company of $240 million over the life of the contract.

The package proposed in early April, which Ferris labeled "exorbitant," called for an increase in total wages and benefits to United's 18,600 IAM-represented employes averaging 43 percent, Ferris said. "With the union and the company so far apart the third time around, it was obvious we could not reach a reasonable settlement at that time," he said.

"The senior management of United Airlines would be derelict in its duty to all employes and shareholders if we accepted an agreement that is beyond your company's ability to pay," Ferris told shareholders. "If we do not keep United financially viable, all employes and shareholders will suffer."

At a press conference following the meeting, Ferris declined to answer specific questions about the current negotiations, citing their "delicate" nature and his reluctance to say anything to disrupt them.

He conceded that the absence of the Mutual Aid Pact "certainly makes a strike more difficult." The pact, made illegal by the signing of the Airline Deregulation Act last October, was an insurance arrangement that provided member airlines with partial reimbursement for revenues lost during a labor strike. During a 16-day machinists' strike against United in 1975, the airline received $48 million in mutual aid benefits, Ferris said.

Ironically, during Northwest Airlines' lengthy pilots' strike last year United paid Northwest $37 million in benefits. Over the life of the MAP, United had paid in $155 million and received just $66 million in benefits.

With the loss of the Mutual Aid Pact, airlines now have every incentive to add flights or begin new service on the struck airlines routes, and some carriers have attempted to do so this month. Ferris said he didn't think any of the new service would have a lasting negative impact on United.

In his report to shareholders Ferris blamed the first quarter loss primarily on a 19 percent increase in expenses, with payroll the biggest single item, while revenues were increasing just 13 percent.Although scheduled passenger traffic was up 27 percent, more than half United's traffic flew on low fares, compared with a third last year. Very bad weather, causing United to cancel 6 percent of its flights, and fuel shortages, causing the cancellation of 4 percent of its total flights in March, also took their toll, Ferris said.

In a related development, United said it will ask the Civil Aeronautics Board to increase most fares in the continental United States 5 percent from July 5 to Aug. 31. United said the increase is permitted under the board's "zone-of-pricing flexibility" which permits airlines to increase fares in all markets by 5 percent for up to 58 days a year.

At the very quiet meeting, United also announced a decision to exercise an option to buy five McDonnell Douglas DC-10s at a total cost, including spare equipment, of $195 million, Delivery is expected in 1981 and 1982.

Announcement was also made at the meeting that Ferris was elected chief executive officer of UAL inc. by the directors, succeeding Carlson, who will remain on as UAL's board chairman. Ferris has been president of UAL since April 1978.

UAL reported first quarter consolidated net earnings of $2.98 million (10 cents a share), compared with $17.1 million (68 cents) in the same period of 1978. Investment tax credit generated by new aircraft scheduled for delivery this year and improved net earnings from hotel operations - UAL's Western International Hotels subsidiary had its best first quarter in history - offset losses from the airline and business services operation. GAB Business Service is UAL's third subsidiary.

Despite United's current problems, Ferris several times today issued ringing endorsements of deregulation and its effect on the public and the airlines. "I predict that in 10 years time, there will be more carriers than we have now, more employes not less, and there'll be more people flying than we ever dreamed possible," Ferris said.