Вопрос задан 25.02.2019 в 19:49. Предмет Информатика. Спрашивает Дёмина Катерина.

Определите, что будет напечатано в результате выполнения данной программы: алг нач целтаб Dat [1:8]

цел k, c Dat[1]=27; Dat[2]=5; Dat[3]=4; Dat[4]=13; Dat[5]=12; Dat[6]=9; Dat[6]=8; Dat[8]=0; c:=0 нц для k от 1 до 8 если Dat[k]>10 и Dat[k]<20 то c:=c+1 все кц вывод c кон
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Барышникова Лера.
Тут программа определяет сколько в массиве чисел, больших 10 и меньших 20. Их только 2.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program Execution Result

The given program is written in a language that is not specified. However, based on the syntax used, it appears to be a pseudocode or a simplified programming language.

The program initializes an array `Dat` with 8 elements, indexed from 1 to 8. The values of the array elements are assigned as follows: - `Dat[1] = 27` - `Dat[2] = 5` - `Dat[3] = 4` - `Dat[4] = 13` - `Dat[5] = 12` - `Dat[6] = 9` - `Dat[7] = 8` - `Dat[8] = 0`

The program then initializes a variable `c` to 0.

Next, a loop is executed from `k = 1` to `k = 8`. Within the loop, the program checks if the value of `Dat[k]` is greater than 10 and less than 20. If this condition is true, the program increments the value of `c` by 1.

Finally, the program outputs the value of `c`.

To determine the final result, let's go through the program step by step:

1. Initialize the array `Dat` with the given values. 2. Initialize the variable `c` to 0. 3. Start the loop from `k = 1` to `k = 8`. 4. Check if `Dat[k]` is greater than 10 and less than 20. - For `k = 1`, `Dat[1] = 27`, which is not within the specified range. - For `k = 2`, `Dat[2] = 5`, which is not within the specified range. - For `k = 3`, `Dat[3] = 4`, which is not within the specified range. - For `k = 4`, `Dat[4] = 13`, which is within the specified range. - Increment `c` by 1. `c = 1`. - For `k = 5`, `Dat[5] = 12`, which is within the specified range. - Increment `c` by 1. `c = 2`. - For `k = 6`, `Dat[6] = 9`, which is not within the specified range. - For `k = 7`, `Dat[7] = 8`, which is not within the specified range. - For `k = 8`, `Dat[8] = 0`, which is not within the specified range. 5. End the loop. 6. Output the value of `c`, which is 2.

Therefore, the program will print 2 as the result of its execution.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос