In reply to m_v:
module test;
int a;
initial begin
for(int i = 0;i<20;i++)begin
a++;
end
$display("a = %0d",a);
end
endmodule
this will gives you the expected answer.
In reply to m_v:
module test;
int a;
initial begin
for(int i = 0;i<20;i++)begin
a++;
end
$display("a = %0d",a);
end
endmodule
this will gives you the expected answer.