By Alexandra Scaggs 

U.S. stock indexes swung between modest gains and losses Wednesday, as energy stocks declined and technology shares staged a rebound.

The Dow Jones Industrial Average rose 35 points, or 0.2%, to 17422. The S&P 500 was nearly flat, gaining less than 0.1% to 2030, and the Nasdaq Composite Index rose 10 points, or 0.2%, to 4692.

Investors are awaiting an afternoon statement from the Federal Reserve's policy-setting committee, as its two-day meeting wraps up Wednesday. The central bank isn't expected to make policy changes. Investors will be looking for clues about when officials could raise interest rates, a move widely expected this year.

Energy shares in the S&P 500 tumbled 1.9% as crude-oil futures resumed their monthslong decline, recently down 2.3% to $45.19 a barrel. Fourth-quarter profits of companies in the sector are expected to shrink by 25% from the previous year, according to FactSet, as the oil-price tumble weighs on their bottom lines.

Technology stocks outperformed, with the tech sector of the S&P 500 up 1.2%. Apple Inc. rallied 6.6% after "staggering" demand for iPhones helped the company beat even the most bullish Wall Street forecasts.

"Apple put up very strong numbers...[which is] good following a day that was a relative bloodbath," said Brian Fenske, head of sales trading at ITG.

But the sector didn't fully recover from its 3.3% drop on Tuesday, when a disappointing earnings report from Microsoft Corp. sent that stock down more than 9%. Microsoft shares fell an additional 1.4% Tuesday.

Investors fret that a strengthening dollar and weak international demand could damage some companies' bottom lines.

"The excuse du jour for large caps missing estimates and giving more cautious guidance is currency," said Alan Gayle, director of asset allocation at RidgeWorth Investments, which manages more than $45 billion. But "fundamentally, the U.S. economy remains sound," he said, so he expects their profit growth to pick up later this year.

After Apple's report, stocks in the S&P 500 are on pace for 1.3% of fourth-quarter earnings growth from last year, according to FactSet, slightly above analysts' projections of 1.1% at the start of reporting season. But without the tech giant's 38% profit growth, fourth-quarter earnings are on pace to make a year-over-year decline 0.5%.

Among Dow components, Boeing Co. jumped 4.8% after it posted better-than-expected quarterly results. But the company gave a weak outlook for profit in 2015, citing the possibility that the dive in oil prices could damage demand for fuel-efficient planes.

AT&T Inc. rose 0.9% after fourth-quarter earnings and sales narrowly beat Wall Street's expectations. But the telecommunications company's results indicated some strain from higher competition among carriers.

In Europe, Greek bonds and stocks continued to slide after last weekend's election of a new leftist government. Investors fear that Syriza's victory could lead to confrontation between the country and its creditors. Stocks of other indebted countries fell as well, with Spain's IBEX 35 down 1.7% and Italy's FTSE MIB slipping 0.8%. Germany's DAX Index gained 0.2%.

In other markets, gold futures slipped 0.3% to $1287.70. Treasury prices rose, pushing the yield on the 10-year note down to 1.798%.

In other earnings news, Yahoo Inc. gained 1.6% after announcing it would spin off tax-free its holdings in Alibaba Group Holding Ltd . Its per-share earnings beat analyst forecasts.

Electronic Arts Inc. rallied 10% after the videogame maker reported strong results from the holiday-shopping season, exceeding Wall Street's forecasts for its quarterly earnings and revenue.

Write to Alexandra Scaggs at alexandra.scaggs@wsj.com

Access Investor Kit for Apple, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US0378331005

Microsoft (NASDAQ:MSFT)
Historical Stock Chart
From Feb 2024 to Mar 2024 Click Here for more Microsoft Charts.
Microsoft (NASDAQ:MSFT)
Historical Stock Chart
From Mar 2023 to Mar 2024 Click Here for more Microsoft Charts.