Why the carrier frequency does not appear after AM modulation?
What you did is multiply two sinusoids with each other:

$$z(n)=\sin(n\theta_1)\cdot\sin(n\theta_2)$$

where $\theta_1=2\pi\cdot 40/1000$ and $\theta_2=2\pi\cdot 4/1000$.
The result $z(n)$ can be written as

$$z(n)=\frac{1}{2}\left[\cos(n(\theta_1-\theta_2))-\cos(n(\theta_1+\theta_2))\right]$$

So you get two sinusoids with the sum and the difference of the two original frequencies, i.e. one with $40-4=36Hz$, and the other one with $40+4=44Hz$. This is exactly what you see in your FFT plot. You use a 1000-point FFT, i.e. the frequency at index $i$, ($i=1,2,\ldots,1000)$, is given by

$$f_i=\frac{f_s}{1000}(i-1)=i-1,\quad i=1,\ldots,1000$$

where $f_s=1000Hz$ is the sampling frequency. You get peaks at $i=37$ and $i=45$, which correspond to frequencies $f_{37}=36Hz$ and $f_{45}=44Hz$, exactly as expected.

I think you made a mistake in the mapping of FFT indices to frequencies.

By the way, with standard amplitude modulation you indeed get the carrier in the spectrum because the modulated signal looks like

$$s(n)=[1+mx(n)]\sin(n\theta_0)$$

where $x(n)$ is your message, $m$ is a scaling factor, $\theta_0$ is the carrier frequency, and the term $1$ which is added to the signal results in the carrier wave in addition to the sidebands. You just multiplied two sinusoids without this constant term, that's why you don't see any carrier. This was already correctly pointed out in chirlu's answer.