What's wrong with my camera

I have a nikon D40 camera and I noticed that on all the pictures there are two black speckles. I cleaned the lens but it still shows up. Is it the lens or the body? Is there anything I can do or do I have to go to a specialist

You have 2 small speck of dust in the camera's sensor, you can simply blow them off using dust blower that are especially made for dslr you can get them in camera stores for cheap price. However u first have to lock the mirror up, there has to be some option for that in the setting, look for manually sensor cleaning option. If you can't find it, best would be take it to Nikon and they will clean it for you.
Sensor cleaning steps:
First find a clean place with no dust.
Select the sensor cleaning, the mirror will lock up. Keep the camera on.
Open the lens, have a look where the specks are and point the camera down so dust will not fall into the sensor.
And with dust blower blow the dust out from the sensor, and turn off the camera.
Now take some shots and see if the dust are still there or not.preferably take a shot of blank wall so you can clearly see the specks in the picture. No specks then your sensor is clean. Thats it.

If there are two black dots/speckles on the same place in all the photos, then it probably is on the camera sensor. I would recommend searching for information on how to clean the camera sensor yourself, or send it in for cleaning in a camera service center.

Sensor dust is especially noticeable when you take a of a cloudless blue sky.
Here is a webpage that has photos of what dust can look like:
http://www.althephoto.com/tips/clean.php
The D40 was prior to Nikon DSLRs that have a dust-off vibration thingie in the camera.