Inc | Dec side effect



Inc / Dec side effect
Smart pascal source code
var a: array [-1 .. 10] of Integer; var i, s: Integer; for i := 1 to 100 do Inc(a[RandomInt(10)]); for i := -1 to 10 do s += a[i]; WriteLn(s); for i := 1 to 50 do Dec(a[RandomInt(10)]); for i := -1 to 10 do s += a[i]; WriteLn(s); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 100 150 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}