Obama: US trumps China for investment, Congress should 'stop being mad'

CNBC with Reuters

President Barack Obama on Wednesday touted his economic success, and the United States' overtaking China as the prime investment location for global business.

"For the first time in more than a decade, if you ask business leaders around the world 'what's the number one place to invest' they don't say China anymore. They say the United States of America," Obama said in a speech in Kansas City. "Our lead is growing."

President Barack Obama speaks at the Uptown Theater in Kansas City, July 30, 2014.
Larry Downing | Reuters

Obama also used the opportunity to lampoon Congress, openly laughing several times at its difficulty in passing bills and at Republican leaders' regular opposition to his political agenda.

"Stop being mad all the time. Stop just hating all the time. Come on," Obama said. "I know they're not that happy that I'm president, but that's OK. Come on. I've only got a couple of years left."

Read MoreChina to overtake US economy; India trumps Japan

But the president pointed to Congress' inaction in explaining his administration's recent executive actions. "We can't wait," he said. "So if [Congress is] not going to do anything, we'll do what we can on our own."

Obama touts GDP
Obama touts GDP

Finally, the president turned to corporate tax inversions—when a company moves its tax base overseas to avoid paying a higher U.S. tax rate—passing a similar judgment on the currently legal practice as he did in an interview with CNBC last week.

"[These companies] are not paying their fair share, and stashing their money offshore—you don't have that option. It ain't right," Obama said. "Not only is it not right, it ain't right."

Read MoreObama: What's legal might not be right for US

U.S. economic growth accelerated more than expected in the second quarter and the decline in output in the prior period was less steep than previously reported, which could bolster views for a stronger performance in the last six months of the year.

Gross domestic product expanded at a 4.0 percent annual rate as activity picked up broadly after shrinking at a revised 2.1 percent pace in the first quarter, the Commerce Department said Wednesday.

Later Wednesday, the Federal Open Market Committee as expected trimmed its monthly asset purchases to $25 billion from $35 billion, which would leave it on course to shutter the program this fall.

—By CNBC.com. Reuters contributed to this report.