International Business Machines Corp. reported yesterday a 3.4 percent decline in second-quarter profits - a surprise to Wall Street analysts who had expected a much better performance. IBM also revealed plans for borrowing $1.5 billion from banks because of heavy demand for its products.

Westinghouse Electric Corp., Meanwhile, posted a steep loss of $79 million for the quarter. Earnings from actual operations increased but Westinghouse suffered one-time losses of $170 million from settlements of uranium supply contract lawsuits.

Separately, a Westinghouse union leader predicted yesterday a strike against the giant frim, on Monday.

The IBM report, in particular, weighed heavily on the stock market. After the earnings statement was distributed at noon, stock prices plunged generally and IBM stock hit a new low for the past 12 months.

IBM said second-quarter profits fell to $667 million ($1.15 a share) from $691 million ($1.19) in the same period last year, although revenues rose to $5.4 billion from $4.9 billion.

Chairman Frank T. Cary said IBM shipments were up substantially in the recent quarter compared with 1978. Profits also were up slightly for the first six months of this year.

"However, in the second quarter, there has been an increase in the proportion of customer decisions to lease rather than purchase data processing equipment, resulting in a lower rate of growth in gross income from purchases than in recent periods," Cary said in a statement accompanying the earnings figures.

Any significant increase in the lease-to-purchase relationship, which reflects fears of recession by customers, tends to have a negative impact on IBM's short-term operations. "The shift . . . along with the continuing inflationary pressures and the build-up of the company's resources to meet strong market demand, are the primary causes of the modest earnings growth for the six months period," Cary stated.

In the recent six months, IBM earned $1.33 million ($2.29 a share) up 4 percent from $1.28 million ($2.19) a year earlier as sales rose 14 percent to $10.65 billion.

IBM said incoming orders, shipments and backlog continue at record high levels - requiring increased investment in resources and rental equipment. IBM said it has started talks with U.S. banks to establish lines of credit of up to $1.5 billion to "meet this demand."

The company's initial 4300 line of new computers is just now being shipped.

IBM long has been in strong financial condition with little debt and large cash reserves. The new borrowing decision "is an indication the company has huge demand" for the new computers, First Boston Corp. analyst Irwin Lieber told The Associated Press.

IBM was the most-active New York Stock Exchange issue yesterday, closing down $1.50 to a yearly low of $70.125 on a volume of 607,800 shares. The recent addition of IBM to the Dow Jones average of 30 blue-chip industrial issues helped drag down that barometer by 7 points to 836.86.

Westinghouse Electric's loss of $79 million in the recent quarter was in contrast with year-earlier profits of $74.8 million (86 cents a share). Sales rose to $1.9 billion from $1.67 billion. Not counting the lawsuit settlement losses, operating earnings in the recent quarter were $90.9 million ($1.06 a share).

In the first half of 1979, operating profits were $174 million 2.02 a share) compared with $141 million ($1.62) last year as revenues rose to $3.7 billion from $3.2 billion. Counting the losses from settling lawsuits, Westinghouse net income for the first half of this year was a slim $4 million (5 cents a share).

Chairman Robert Kirby said Westinghouse has settled 10 of 17 uranium supply contract suits, brought by Virginia Electric & Power Co. and other utilities.Settlements to date account for 55 percent of total uranium supplies claimed in the disputes.

The International Union of Electrical Workers, meanwhile, rejected a contract offer from Westinghouse and predicted a strike at 12:01 a.m. Monday as "likely." The Pittsburgh firm is conducting talks on new contracts with four unions. The contracts all expire on Monday.

News Services also reported the following:

Burroughs Corp., a Detroit-based computer firm, reported record earnings, revenues and orders for the second quarter of 1979.

Chairman Paul S. Mirabito said net earnings for the second quarter were $68.9 million ($1.68 a share), a 20 percent increase over 1978 second quarter earnings of $57.4 million ($1.41). Revenues for the second quarter were $688.5 million, an increase of 16 percent over $593.7 million in the year-earlier period.

Mirabito said incoming orders continued a healthy upward trend in both the U.S. and overseas market. He said the April-June period was the first quarter in the company's history in which incoming orders exceeded the $1 billion level.

Owens-Illinois, Inc. reported second quarter earnings of $47.3 million $1.63 a share, an increase of 10 percent from $42.9 million ($1.48) in the same period a year ago.

Sales for the period amounted to $879.2 million, 8 percent greater than sales of $814.4 million last year. Sales during the first six months of 1979 were up to $1.7 billion, earnings were $65.3 million, and earnings per common share were $2.23. This compared with sales of $1.51 billion and earnings of $52.1 million, or $1.77 per common share a year ago, the company said.