Write a program that calculates the sum of the first N even positive numbers. Initial data

Write a program that calculates the sum of the first N even positive numbers. Initial data (N – number of numbers) are entered from the keyboard. The results of the program’s operation are written to the Out.txt file.

program numbers; // program names
var
num, i, sum: integer; // Set variables
begin;

assign (f1, ‘Out.txt’);
rewrite (f1); // Prepare the file for recording
i: = 0; // initialize them
sum: = 0;
readln (num); // read the value
while i <= num do // create a loop that performs actions while i <= num
begin
sum: = sum + i * 2; // write to the variable sum the value of itself plus the value of an even number, namely i * 2
i: = i + 1;
end;
writeln (f1, sum); // write

close (f1);
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.