Problem with multiplication

Hi, I have always used rcm2200 for my projects. Now I am trying to scale to 3365. I have done some testings and everything was working properley. However I am stuck because whenever I multyply 4*10000, i get a negative result… any ideas of why this migh be happening??

Make sure you have an “l” (lower case L) behind the “10000”: 4*10000l. Also the target of the assignment must either be “unsigned int” or “long”. Otherwise the compiler generates code for 16-bit and 40000 would be treated as a negative integer value.