how to set an array from -100 to 100? numbers should go in order, without a random?

  • 3
    in the cycle from -100 to 100 - Grundy

1 answer 1

Pascal allows you to specify a range of indices for an array, so you can do this:

A : array [-100..100] of integer 

And fill in a simple loop:

 For i:=-100 to 100 do a[i] := i; 

Ideone working example