Much depends on the context.
Fellow car enthusiast asking, thread on the forum, one thing. Not rude, perfectly acceptable.
Acquaintance or someone who you don't know well such as a coworker, or the attendant at your local gas station, another. They usually want to know if you paid cash or financed, and if so what is your payment, too. None of their business.
Sometimes it's a young kid who might aspire to drive your car one day, who knows. Tell them something positive and inspirational.
Hell, I've had people yell out their car on the road at a stoplight on my motorcycle, "nice bike man, how much?!" Literally in the same sentence. I'll never see the guy again, so not rude but kind of funny, and definitely not very tactful. Sometimes I tell them, sometimes I say, "they range, check out the Ducati website" and ride off
It depends on the context of the question and the intent of the asker. Usually it's not too difficult to use your intuition to determine this and answer accordingly.