Mr Obama added: “The guy who’s standing where I stand has the nuclear codes with him. He can order 21-year-olds into fire.
“This is reported as entertainment but as you get closer (to the election) the reality has a way of intruding. The American people are pretty sensible and I think they’ll make a sensible choice.”
Mr Obama was speaking at a press conference in California after hosting a summit with Southeast Asian leaders.
He also attacked the Republican Party saying foreign observers were “troubled” by the rhetoric of its candidates.
He said: “This is not just Mr. Trump. Everyone’s focusing on Trump because he says it in a more interesting way. He may up the ante in anti-Muslim sentiment, but if you look at what the other Republican candidates have said, that’s pretty troubling, too. They’re all denying climate change and that’s troubling to the scientific community.”
Mr Trump responded: “This man has done such a bad job and set us back so far. The borders are like Swiss cheese. For him to say that is actually a compliment.
“He’s lucky I didn’t run last time, when (Mitt) Romney ran, because he would have been a one-term president.”
Mr Obama also singled out Marco Rubio, the Florida senator and Republican presidential candidate, although he did not name him.
He referred to a law Mr Rubio had proposed to solve the immigration crisis, which the president himself had supported.
Mr Obama said: “Now he’s running away from it as fast as he can.”
The president refused to make a choice between the two Democratic candidates Hillary Clinton and Bernie Sanders.
But he vowed to nominate a replacement for Antonin Scalia, the US Supreme Court Justice who died at the weekend, despite the prospect of Republicans in the Senate refusing to hold a confirmation hearing.
Mr Obama said: “I’m going to do my job and I expect them to do their job too. I expect them to hold hearings and I expect there to be a vote.”
He also said Russia’s involvement in Syria was testament to the Syrian government’s weakness and it would be “smarter” for Vladimir Putin to help broker a political transition . He said: “You send in your army when the horse you’re backing isn’t effective.”