On the first day, the swimmer swam 3 km. On each subsequent day, he swam 0.5 more than on the previous day.

On the first day, the swimmer swam 3 km. On each subsequent day, he swam 0.5 more than on the previous day. On what day will a swimmer begin to swim more than 5 km per day. Pascal program.

The main condition of the problem is given in the last sentence.
Until the variable that represents the distance the swimmer has swum is 5 or greater than five, the program must increment a variable that is equal to the number of days spent.
We need a variable that represents the starting mileage:
day_km: = 3;
day_nom: = 1;
Next, we create a condition for the program to work:
while (day_km <5) do
begin
First, you need to increase the day number by one, so that you can then know the number of all days:
day_nom: = day_nom + 1;
Secondly, you need to increase the number of kilometers:
day_km: = day_km + 0.5;
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.