You didn't provide any information on the coin's condition or mint mark. Here are some typical values for 1940 quarters from Philadelphia (no mint mark), Denver (D), and San Francisco (S). "Good" condition means fairly heavy wear but all wording and major details visible, "Fine" can be interpreted as light to moderate wear, and "Extremely Fine" means the coin has essentially no wear.
Regardless of mint mark, a 1940 quarter would be worth around $3 in Good condition and maybe $6 in Fine condition. In XF, a Philadelphia issue would retail for about $10, a 1940-S would be about $15 and a 1940-D would be about $30.