Вопрос задан 29.04.2019 в 15:53. Предмет Информатика. Спрашивает Качкин Данёк.

В алгоритме, записанном ниже, используются переменные a и b. Символ «:=» обозначает оператор

присваивания, знаки «+», «-», «*» и «/» — соответственно операции сложения, вычитания, умножения и деления. Правила выполнения операций и порядок действий соответствуют правилам арифметики. Определите значение переменной b после выполнения алгоритма: а := 3 b := 5 a := 6 + a*b b := b + a/3 В ответе укажите одно целое число — значение переменной b
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Киреев Влад.
А = 6 + 3*5 = 21
b = 5 + 21/3 = 12

0 0
Отвечает Мартышкин Алексей.
Ответ 12

Надеюсь помог!
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Algorithm Explanation:

The given algorithm involves the use of variables 'a' and 'b' and performs a series of arithmetic operations. Let's break down the algorithm step by step to determine the value of variable 'b' at the end.

1. Initialize variable 'a' with the value 3: a := 3 2. Assign the value 5 to variable 'b': b := 5 3. Assign the value 6 to variable 'a': a := 6 4. Perform the operation 'a * b' and assign the result to variable 'a': a := a * b 5. Perform the operation 'b + a / 3' and assign the result to variable 'b': b := b + a / 3

To find the final value of variable 'b', we need to evaluate the algorithm step by step.

Step 1:

- Variable 'a' is initialized with the value 3: a := 3

Step 2:

- Variable 'b' is assigned the value 5: b := 5

Step 3:

- Variable 'a' is assigned the value 6: a := 6

Step 4:

- Perform the operation 'a * b' and assign the result to variable 'a': - The current value of 'a' is 6. - The current value of 'b' is 5. - The result of the operation 'a * b' is 30. - Variable 'a' is updated with the result: a := 30

Step 5:

- Perform the operation 'b + a / 3' and assign the result to variable 'b': - The current value of 'b' is 5. - The current value of 'a' is 30. - The result of the operation 'a / 3' is 10. - The result of the operation 'b + a / 3' is 15. - Variable 'b' is updated with the result: b := 15

Therefore, the final value of variable 'b' after executing the given algorithm is 15.

0 0

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

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

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