IBM (NYSE:IBM) and McDonald's (NYSE:MCD) are storied brands recognized around the world. Even so, both have experienced revenue declines in recent years and were in the midst of executing strategies to return to growth when the coronavirus pandemic struck.

The pandemic and resulting economic downturn affected every business, IBM and McDonald's included. Let's look at where these iconic organizations are now to determine which is the better buy.

A tech nerd opens his mouth to eat a hamburger made of computer parts.

Image source: Getty Images.

IBM's path to success

Last year, IBM experienced a 3.1% year-over-year decline in revenue to $77.1 billion from $79.6 billion in 2018. Its turnaround plan focuses on expanding its artificial intelligence and cloud computing offerings. To that end, in 2019 the company acquired Red Hat, a leading provider of open-source cloud computing technology.

The acquisition proved beneficial. In the company's first-quarter 2020 earnings report, Red Hat revenue increased 18% year over year while overall company revenue was down 3.4%.

The cloud computing industry is on a growth trajectory. IBM carved out its niche in the space by targeting hybrid cloud solutions. This approach allows clients to combine the low cost of public cloud services for IT infrastructure while maintaining control of sensitive data in a private cloud. The hybrid cloud market was valued at over $44 billion in 2018 and is predicted to grow to more than $173 billion by 2025.

Despite the pandemic's emerging impact in Q1, IBM's cloud and cognitive software division, under which Red Hat falls, contributed revenue of $5.2 billion, up 5% from 2019. This division also had the highest gross margin at 75.4%, while IBM's overall gross margin was 45.1%.

The company is well-positioned to weather the economic downturn. IBM's clients are governments and businesses such as financial institutions, which rely on IBM for core IT technologies.

Moreover, it has a solid balance sheet with $153.4 billion in total assets against total liabilities of $133.3 billion. Its confidence in its financial health led IBM to raise dividends for the 25th consecutive year in April.

The turnaround plan for McDonald's

McDonald's experienced lower revenue in both 2018 and 2019 compared to 2017, and so it commenced a strategy to reinvigorate sales called the Velocity Growth Plan.

The company's turnaround plan involved modernizing its restaurants and delivering new solutions to improve the customer experience, such as ordering via in-store kiosks or on a mobile app, and providing delivery services, which generated over $4 billion in global sales last year.

McDonald's ended 2019 on a positive note. The company's restaurants, both owned and franchised, increased comparable-store sales by 5.9%, the highest in over a decade.

It began 2020 on equally strong footing with comps rising to 7.2% through February before the pandemic caused massive disruption. Its restaurants worldwide could no longer accept dine-in customers, and about 25% had to close completely. McDonald's finished the first quarter with revenue down 6% year over year.

The company had $5.4 billion in cash and equivalents in Q1 and generated $1.5 billion in cash from operations, positioning it to weather the economic slowdown. Its business model generates more than half its revenue from fees and rents charged to franchisees. Over 90% of its worldwide restaurants are franchised, keeping costs down.

The pre-pandemic performance suggests its turnaround strategy is working. Once consumer behavior returns to normal, McDonald's is likely to see continued success under its Velocity Growth Plan.

The final verdict

McDonald's was severely affected by the pandemic-induced government restrictions. Given the dramatic decline in its business just in March, the second quarter will likely deliver poor results. So investors have to look at the long term. McDonald's possesses a solid business model and a strong brand that will sustain it for years to come.

IBM is also a powerful brand, allowing it to win its share of enterprise clients in the competitive cloud-computing space. As the company increases its cloud customer base, revenue growth will follow. IBM also offers an attractive dividend with a yield currently at 5.51%, substantially higher than McDonald's 2.71% yield.

Both companies are solid investment choices. If I had to choose one, I give a slight edge to IBM. Cloud computing is expected to expand at a compound annual growth rate (CAGR) of 22.25% through 2025. The quick-service restaurant industry is forecast to grow at a 5.5% CAGR through 2027. IBM can reap the benefits of the cloud computing market's greater growth, making it the better buy and -- given its dividend yield -- a great stock for your retirement portfolio as well.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.