Scientifically speaking : The ones that have seeds inside are fruits whereas the ones with no seeds are veggies.
It is often confused that tomatos and cucumber are veggies or fuits.