STORY: Wall Street's main indexes closed higher on Friday, buoyed by a rally in megacap growth stocks and inflation data that showed only a moderate uptick in U.S. prices.

The Dow added four-tenths of a percent, the S&P 500 climbed 1% while the Nasdaq jumped 2%.

Shares of Alphabet gained nearly 10% to close at a valuation above $2 trillion for the first time after better-than-expected quarterly results a day earlier, during which it also announced its first-ever dividend.

Microsoft shares rose more than 1.5% after its quarterly revenue and profit exceeded Wall Street estimates, driven by gains from artificial intelligence across its cloud services.

Keith Buchanan is senior portfolio manager at GLOBALT Investments.

"Microsoft and Alphabet are showing that the AI theme is moving from concept to revenue to cash flow in a very dramatic and accelerated pace frankly. [FLASH]We have questions where the multiple goes as you move from concept to revenue to cash flow and does that contraction hamper the upside for some of these names. But on a day like today that doesn't matter. The positivity of that theme actually materializing for these companies, and driving income, and in a way revenue and guidance particularly, in a way that bolsters optimism for the group going forward."

A report from the Commerce Department showed U.S. inflation rose moderately in March. The data offered some relief to financial markets spooked by worries of stagflation. After the report, money markets priced in a stronger chance of a Federal Reserve rate cut in September.

In other company news, shares of Snap surged more than 27.5% after the social media firm beat first-quarter estimates for revenue and user growth.

And shares of Exxon Mobil shed more than 2.5% after America's largest oil company missed analysts' estimates with first-quarter profit falling 28% from a year ago.