Apple Inc. became the latest company to pledge hundreds of billions of dollars in US investments that President Donald Trump claimed credit for.