Some sample runs of Pascal are given here:
Note that your program should only print out the triangle and no extra message.
If you enter modulo = 2 and row = 20, you'll get...
1
1 1
1 0 1
1 1 1 1
1 0 0 0 1
1 1 0 0 1 1
1 0 1 0 1 0 1
1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 1 1
1 0 1 0 0 0 0 0 1 0 1
1 1 1 1 0 0 0 0 1 1 1 1
1 0 0 0 1 0 0 0 1 0 0 0 1
1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
If you enter modulo = 3 and row = 20, you'll get...
1
1 1
1 2 1
1 0 0 1
1 1 0 1 1
1 2 1 1 2 1
1 0 0 2 0 0 1
1 1 0 2 2 0 1 1
1 2 1 2 1 2 1 2 1
1 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 1 1
1 2 1 0 0 0 0 0 0 1 2 1
1 0 0 1 0 0 0 0 0 1 0 0 1
1 1 0 1 1 0 0 0 0 1 1 0 1 1
1 2 1 1 2 1 0 0 0 1 2 1 1 2 1
1 0 0 2 0 0 1 0 0 1 0 0 2 0 0 1
1 1 0 2 2 0 1 1 0 1 1 0 2 2 0 1 1
1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1
1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0 1 1
If you enter modulo = 5 and row = 20, you'll get...
1
1 1
1 2 1
1 3 3 1
1 4 1 4 1
1 0 0 0 0 1
1 1 0 0 0 1 1
1 2 1 0 0 1 2 1
1 3 3 1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