Вопрос задан 02.09.2020 в 14:07. Предмет Информатика. Спрашивает Ларионов Артём.

2. Нарисуйте блок-схему алгоритма для решения задачи: Дайы 2 числа. Если они не равим, то найти

их сумму, иначе найти их произведение.​
0 0
Перейти к ответам

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

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

Algorithm for Finding the Sum or Product of Two Numbers

To solve the given problem of finding the sum or product of two numbers, we can use the following algorithm:

1. Start 2. Input the first number, let's call it `num1` 3. Input the second number, let's call it `num2` 4. Check if `num1` is not equal to `num2` - If true, go to step 5 - If false, go to step 7 5. Calculate the sum of `num1` and `num2` and store it in a variable, let's call it `sum` 6. Output the value of `sum` and go to step 8 7. Calculate the product of `num1` and `num2` and store it in a variable, let's call it `product` 8. Output the value of `product` 9. Stop

The block diagram for this algorithm can be represented as follows:

``` +---------+ | Start | +---------+ | V +---------+ | Input | +---------+ | V +---------+ | Input | +---------+ | V +---------+ | Check | +---------+ | V +---------+ | Calculate | +---------+ | V +---------+ | Output | +---------+ | V +---------+ | Output | +---------+ | V +---------+ | Stop | +---------+ ```

This algorithm takes two numbers as input and checks if they are equal. If they are not equal, it calculates their sum and outputs it. If they are equal, it calculates their product and outputs it.

0 0

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

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

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