The way you're toggling isn't ideal, and you could avoid having to specify which elements to open/close if you loop through all the 'li' elements on each click. That would also make it easy to expand upon in the future.
That said... a quick answer to your question is below:
$('.fruit_submenu').hide();
$('.veg_submenu').hide();
$('li#fruit').click(function () {
$(".fruit_submenu").slideToggle();
$('.veg_submenu').slideUp();
});
$('li#veg').click(function () {
$(".veg_submenu").slideToggle();
$('.fruit_submenu').slideUp();
});
$('li#snacks').click(function () {
//force the other elements to slide up no matter their state.
$('.fruit_submenu').slideUp();
$('.veg_submenu').slideUp();
});