An integer N is given. Find the value of the expression 1 + 2! +3! + … + N!,

An integer N is given. Find the value of the expression 1 + 2! +3! + … + N!, Output the result as a real number. (N! = 1 · 2 · 3 ·… · N – N factorial) pascal

program sum;
var N: integer;
s, s1: real;
begin
write (‘Enter number N:’);
readln (N);
s: = 1;
s1: = 0;
for i: integer: = 1 to N do
begin
s: = s * i; // calculates the factorial of the number i
s1: = s1 + s; // calculate the sum of the factorials
if i <N then write (s, ‘+’) else write (s, ‘=’);
end;
writeln (s1)
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.