From science bob.com
To really figure out if a tomato is a fruit or vegetable, you need to know what makes a fruit a fruit, and a vegetable a vegetable. The big question to ask is, DOES IT HAVE SEEDS? If the answer is yes, then technically, (botanically) you have a FRUIT. This, of course, makes your tomato a fruit. It also makes cucumbers, squash, green beans and walnuts all fruits as well. Along with the fruit from from a plant or tree, we can often eat the leaves (lettuce,) stems (celery,) roots (carrots,) and flowers (broccoli.) Many of these other parts of the plant are typically referred to as VEGETABLES. Now don't go looking for tomatoes next to the oranges in your grocery stores; fruits like tomatoes and green beans are usually (alas, incorrectly) referred to as "vegetables" in most grocery stores and cookbooks. NOW YOU KNOW!
When you are up to your butt in alligators, it is hard to remember your intent was to drain the swamp. Stay focused!