program ArithmeticProgression;
vararr: array[1..100] of integer;n, d, i: integer;isArithmetic: boolean;
beginwrite('Enter the number of elements in the sequence: ');readln(n);
write('Enter the first element of the sequence: ');readln(arr[1]);
write('Enter the common difference: ');readln(d);
isArithmetic := true;
for i := 2 to n dobeginarr[i] := arr[i-1] + d;
end;
if isArithmetic thenwriteln('The sequence is an arithmetic progression.')elsewriteln('The sequence is not an arithmetic progression.');
end.
program ArithmeticProgression;
var
arr: array[1..100] of integer;
n, d, i: integer;
isArithmetic: boolean;
begin
write('Enter the number of elements in the sequence: ');
readln(n);
write('Enter the first element of the sequence: ');
readln(arr[1]);
write('Enter the common difference: ');
readln(d);
isArithmetic := true;
for i := 2 to n do
if (arr[i] <> arr[i-1] + d) thenbegin
arr[i] := arr[i-1] + d;
begin
isArithmetic := false;
break;
end;
end;
if isArithmetic then
writeln('The sequence is an arithmetic progression.')
else
writeln('The sequence is not an arithmetic progression.');
end.