Republican Donald Trump won North Carolina, capturing one of the seven heavily contested battlegrounds while votes in six other swing states are still being counted.