Given a geometric progression 3, 6, 12, 24, … What will be the sum of its 13 members? (compose a program in pascal)

program zz1;

var n, i, s: integer; // set a variable of integer type

begin

n: = 3; // set the first term of the geometric progression

for i: = 1 to 13 do // organize a loop for thirteen repetitions

begin

write (n, ”);

s: = s + n; // get the sum by adding another member of the geometric progression to it

n: = n * 2; // get the next member of the geometric progression

end;

writeln; // go to a new line to display the response

write (‘sum of thirteen members of a geometric progression =’, s); // display the answer

end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.