cucumbers are a fruit...they contain seeds, just like tomatoes.
if It has seeds its a fruit. That's the rule. (yes even pumpkins) All cucumbers and squashes (all members of the 'Cucurbit' family) are fruits.
A cucumber is a plant which bears fruit. When you eat a cucumber, you are technically eating a fruit. Legally, they are sold as vegetables due to how consumers view them. This is similar to a tomato.
Fruit
It is technically a fruit