Yea but the d40 is 6.1 megapixels.. My current $80 camera is 6.1 megapixels, and more megapixels = higher resolution.
The quality of the 6.1MP of your camera is nothing compared to the one of the D40.
You don't need that much MP to get beautiful pictures. 4.1 was enough for me. Unless you have a huge Home Cinema where you plan to watch your pictures, 6MP is enough.
Here are some pictures (actually lot ) that i took with D40:
All of them are either taken with the P or M mode (Program or Manual). P takes care of aperture and shutter speed while M is fully customizable.