That's exactly what's happening!!! Testing your code and making the variables volatile you get to see it working!!And you verified the answers how?
Since nothing is actually done with these numbers, the compiler may optimize them out - putting volatile ints and floats tells the compiler not to remove them.
Also, your code should have an infinite loop to prevent the controller from getting into undefined operations (typically done with a while (1){} loop).
Also, use code tags when posting code (button that looks like "#", which will put your code between two tags: [CODE ] and [/CODE ] (use without spaces in the tags)).
#include<xc.h> // I use XC8.
#include<stdlib.h>
#include<math.h>
void main()
{
volatile int i=12,d=15,t=0,k=0,b=0,m=0;
volatile float j=0;
t=i;
b=(i*2);
k=i/3;
j=i;
m=i+d;
}
Setting the Hi-Tech C or XC8 compiler in free mode(or lite mode) also works. If you just want to single step your code and see the result while debugging