It doesn't take long in stock investing to realize how volatile the stock market can be. It's a continuous cycle of ups and downs that's been going on since the market was created and will probably continue as long as the stock market as we know it today exists.

You can't predict how stocks will move in the short term, but some companies have shown the ability to consistently produce good results over the long run. For investors looking for stocks they can lean on long term, look no further than these five companies. Investing $100 in each one will expose you to growth opportunities, reliable dividend income, and stability.

1. Microsoft

Among tech companies, Microsoft (MSFT 1.82%) is in a league of its own when it comes to the amount of ground its products and services cover. Many tech companies have a product (Apple's iPhone) or service (Alphabet's Google search advertising) that makes up most of their revenue, but Microsoft has built out a diversified ecosystem that no big tech company rivals.

Its diversified business -- along with the number of corporate clients it services -- gives Microsoft an extra layer of protection during rough economic times and market downturns. Foregoing the latest electronics or cutting back on advertising is more feasible than foregoing cloud services, abandoning Microsoft Office, or passing over LinkedIn for recruiting.

Countless businesses worldwide rely on Microsoft for their operations, giving the company a great long-term outlook.

2. Coca-Cola

Coca-Cola (KO) has been one of the poster children for blue-chip stocks for quite some time. Its flagship soda is one of the most widely distributed products in the world, selling in more than 200 countries.

Despite the success of its core soda products like Coca-Cola and Sprite, Coca-Cola has proved it won't settle for complacency. The company consistently adds products to its portfolio that reflect changing consumer preferences. A recent example is the company embracing alcohol ready-to-drink beverages with Topo-Chico hard seltzer and Simply Spiked.

An ability to adapt with time and a dividend yield that's increased for 61 straight years makes Coca-Cola a company that can be a long-term staple in an investment portfolio.

3. Procter & Gamble

Procter & Gamble (PG -0.78%) (P&G) owns some of America's best-known consumer goods brands. P&G itself may not be a household name, but its brands like Tide, Pampers, Bounty, Old Spice, Tampax, and dozens of others surely are.

Most of the products P&G sells are essential, so they sell regardless of economic conditions. It's easy to cut back on entertainment and eating out when money's tight. Personal hygiene products? Not so much. This makes P&G as recession-proof of a stock as you'll find.

The stock might not have hypergrowth in its future, but its dividend is as reliable as they come. P&G has increased its payout for 67 straight years and paid one for 133 years.

4. Berkshire Hathaway

Berkshire Hathaway (BRK.B -0.69%) (BRK.A -0.76%) is a conglomerate that's become one of the world's most valuable companies, with a market capitalization of more than $750 billion. Over time, Berkshire Hathaway has built a sizable stake in many top companies, including Apple, Bank of America, Coca-Cola, American Express, and countless others.

Led by Warren Buffett and his extraordinary team, Berkshire Hathaway has consistently outperformed the S&P 500, which is typically the goal when investing in individual companies. It has outperformed the S&P 500 in seven out of the last 10 years, and from 1965 to 2022, it had a compound annual growth rate of 19.8% to the S&P 500's 9.9%.

With a thriving insurance and logistics business and billions of dollars in passive income from the dividends of its holdings, Berkshire Hathaway will continue to be a powerhouse for the foreseeable future.

5. Visa

Visa (V -0.23%) is the world's leading payment-processing company and a textbook example of how effective a competitive advantage can be for a company. In Visa's case, its competitive advantage is its reach. As of June 30, Visa had over 4.3 billion cards in circulation and is accepted by more than 130 million merchants globally.

Much of the investments it took to expand Visa's reach have already been made, so now the company can reap the benefits. Visa makes money by taking a percentage of transactions on its network or with its cards, so it doesn't have to take on additional costs to make money like a company that sells physical products. This has led to it having margins that few companies can compete with (80% gross profit margin).

As the world progressively turns to digital and cashless transactions, Visa's importance will be further solidified. It's a stock I feel comfortable buying and consistently adding to over time.