Botanically, Tomato is a berry (Fruit). But, generally we divided a crop based on their culinary uses. That's why tomato is a vegetable. Although, there are many confusing examples. Like, Watermelon, it is considered as vegetables not a fruit, although it's culinary use is as fruit. In South East Asian, and many african countries Jackfruit, Papaya etc. are consumed when they are raw and cooked as veggies. But, when they ripe they are eaten as fruit. But, botanically both are classified as fruit. I hope this answers your queries.