How to compose in Pascal a program for calculating the sum of all natural numbers not exceeding

How to compose in Pascal a program for calculating the sum of all natural numbers not exceeding a given natural number N?

var
i, n, s: integer; // declare three variables of integer type.
begin
writeln (‘Enter a natural number:’); // display a text string.
readln (n); // write the input from the keyboard to the variable n.
for i: = 1 to n do // start of the cycle, with the number of repetitions equal to the number n.
begin
s: = s + i; // at each step of the loop, add the value of the i variable to the s variable.
end;

writeln (‘The sum of natural numbers from 1 to’, n, ‘is equal to:’, s); // display the line with 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.