US President Donald Trump was welcomed by the Queen to Windsor Castle as the official part of his whirlwind visit to the UK drew to a close.