In reply to Manoj J:
you are right they got executed in parallel.
But what is important to understand that both variables a & b changed their values from 0-9 in zero time.
So its just that simulator has to choose whose $display to flush first.
If you want to see the parallel execution.
You must see the change w.r.t. time.
Just small modification in your code :
module top;
int a,b;
initial fork
for(int i=0;i<10;i++)
#10 $display("a=%d",i);
for(int j=0;j<10;j++)
#10 $display("b=%d",j);
join
endmodule
will get the output as desired !