The royal couple hosted the Microsoft co-founder on Tuesday in their role as patrons of their Royal Foundation. The meeting with Mr Gates, the co-chairman and trustee of the Milland Melinda Gates Foundation, was not publicly announced beforehand. The Royal Foundation tackles issues including mental health, early years, wildlife conservation, young people and the armed forces community.
The billionaire has given around $35.8billion (£29.3billion) to charity in his life.
Earlier this week Mr Gates said he believes probiotics will help to solve malnutrition over the next two decades.
Mr Gates said that malnutrition is the “greatest health inequity in the world”, accounting for half of all childhood deaths in sub-Saharan Africa.
The royals had a meeting with billionaire Bill Gates
He said: “All of us rely on our body’s microbiome to function properly. We have more microbial cells living inside our bodies than human cells.
“These bacteria protect us from infection and are particularly essential to digestion. For example, your body literally cannot break down certain types of plant fibres without an assist from the bacteria in your gut.”
The website of The Royal Foundation says: “The Royal Foundation supports a broad and ambitious spectrum of activity. We bring people, ideas and resources together to understand issues, explore creative solutions and be a catalyst for long-term impact.”
Mr Gates founded Microsoft and created Windows.
In 1986 when his company went public, 45 percent of the shares were awarded to Bill Gates.
In 2005, Mr Gates received an honorary knighthood for his charitable work and his achievement in creating the world’s most successful software company.
Honorary knighthoods are awarded by the Queen, on the advice of the Government, to those who have made an important contribution to British interests.
In a statement from the time, Mr Gates said: “I am humbled and delighted. I'm particularly pleased that this honour helps recognise the real heroes our Foundation supports to improve health in poor countries.
“Their incredible work is helping ensure that one day all people - no matter where that are born - will have the same opportunity for a healthy life.
“This honour is particularly poignant given the deep connections that Microsoft enjoys with the United Kingdom.
“Over the past 20 years we have benefited greatly from strong business partnerships and the tremendous wealth of talent and creativity of our UK employees and researchers.”