Which is more reliable on the pictures? The camera body? Or the lense?

I'm thinking of getting the Nikon d40, but I'm just getting it's body probably (without the lense) because it's already like $300 like that, but I've seen pictures taken with it and they are fantastic quality, and I know nothing about cameras, so is it dependent on the lense? I don't know anything about lenses, i just want a normal one that will continue the great quality I've seen of pictures on the internet. Do I have to get a specific lense to make it good?
Is the Nikon d40 even have detachable lense?
I'm trying to stay under 300 or $400 for christmas. I doubt I could go over $350.

That's ok. There are plenty of lenses to choose from.
Why not try an 18-135mm vr?
Only thing is it may cost nearly as much as the camera body, but it will be a great starter. You would be able to do so much with this set up.

An inexpensive DSLR with a great lens is better than a pro-DSLR with a mediocre lens.

We used to say that "the camera is an accessory, the important thing is the lens"
For $180 US Dollars you have the Nikon 18-55mm VR:
http://www.kenrockwell.com/...5mm-vr.htm
VR: Vibration reduction

The glass - lens - is what "makes" the photo. A good lens will stay with you for many years while you will upgrade the body. I think the D40 would be a good body to get and spend the rest of your budget on a good lens.
- I have a Nikon D40, if I get a reliable lens will they take more professional photos?
- I have a Nikon d100 and a Vivitar macro lense.can i use the lense on the SLR-body?
- Which camera has more/better fisheye lense options?
- Does more megapixals the camera have take up more memory from your sd card?
- Which DSLR camera is nice, better, durable and reliable?