Write a program to find the minimum element of an array X, consisting of 6 elements, the values of which
April 29, 2021 | education
| Write a program to find the minimum element of an array X, consisting of 6 elements, the values of which are calculated by the formula X = (sini-1) / 2cosi + 1 Language Turbo Pascal
const
N = 6;
var
i: integer;
x: array [1..N] of double;
min: double;
begin
// form the array in accordance with the condition
for i: = 1 to N do
x [i]: = (sin (i) -1) / (2 * cos (i)) + 1;
min: = x [1]; // assign the minimum to the value of the first element of the array
// Check the array starting from the second element
// if the current element is less than the minimum
// then the minimum is assigned the value of the current element
for i: = 2 to N do
if x [i] <min then min: = x [i];
writeln (‘Minimum value =’, min);
end.
![](/01.jpg)
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.