Garlic is not a fruit. It is a vegetable that belongs to the onion family. Although commonly used as a flavoring agent, garlic is botanically classified as a vegetable.
Fruits are the mature ovaries of flowering plants that contain seeds. Garlic cloves, on the other hand, are bulbs which are modified underground stems that store food for the plant.
Therefore, garlic is classified as a vegetable.