Both works here.

function main()
{
execute("temp=1;");
execute("temp+=1;");
}

But "temp" is not defined in lite-C, only in WDL, maybe you were using lite-C instead of WDL?