President Barack Obama has ordered flags flown at half-staff as the nation mourns the lives lost in the worst mass shooting in American history.