PROGRAM ArithmeticProgression;VARa1, d, n, S: REAL;BEGINWRITE('Enter the first term of the arithmetic progression: ');READLN(a1);
WRITE('Enter the common difference of the arithmetic progression: ');READLN(d);
WRITE('Enter the number of terms in the arithmetic progression: ');READLN(n);
S := n/2 (2a1 + (n - 1) * d);
WRITELN('The sum of the first ', n:0:0, ' terms of the arithmetic progression is ', S:0:2);END.
PROGRAM ArithmeticProgression;
VAR
a1, d, n, S: REAL;
BEGIN
WRITE('Enter the first term of the arithmetic progression: ');
READLN(a1);
WRITE('Enter the common difference of the arithmetic progression: ');
READLN(d);
WRITE('Enter the number of terms in the arithmetic progression: ');
READLN(n);
S := n/2 (2a1 + (n - 1) * d);
WRITELN('The sum of the first ', n:0:0, ' terms of the arithmetic progression is ', S:0:2);
END.