Вопрос задан 04.05.2019 в 04:07. Предмет Информатика. Спрашивает Малышева Олька.

Написать программу находящую сумму , произведение , максимальные и минимальные значения из трех

значений ,переменных a b c .. и блок схему
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Горбунова Ольга.
#include <iostream>
#include <clocale>
using namespace std;
int main() {
setlocale(LC_ALL, "rus");
int a, b, c, min, max;
cout << "Введите первое число: ";
cin >> a;
cout << "Введите второе число: ";
cin >> b;
cout << "Введите третье число: ";
cin >> c;
cout << "\nСумма трех чисел равна: " << a + b + c ;
cout << "\nПроизведение трех чисел равно: " << a * b * c << endl;
if (a > b && a > c) max = a;
  else  if (b > a && b > c) max = b;
   else if (c > a && c > b) max = c;
if (a < b && a < c) min = a;
 else if (b < a && b < c) min = b;
  else if (c < a && c < b) min = c;
cout << "\nМинимальное значение среди трех чисел: " << min;
cout << "\nМаксимальное значение среди трех чисел: " << max << endl;
cout << endl;
system("pause");
return 0;
}
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program to Find Sum, Product, Max, and Min Values of Three Variables

To achieve this, you can write a simple program in Python. Here's a program that takes three variables `a`, `b`, and `c` as input and calculates their sum, product, maximum, and minimum values.

```python # Input a = float(input("Enter the value of a: ")) b = float(input("Enter the value of b: ")) c = float(input("Enter the value of c: "))

# Calculations sum_abc = a + b + c product_abc = a * b * c max_abc = max(a, b, c) min_abc = min(a, b, c)

# Output print("Sum of a, b, and c:", sum_abc) print("Product of a, b, and c:", product_abc) print("Maximum value among a, b, and c:", max_abc) print("Minimum value among a, b, and c:", min_abc) ```

Flowchart for the Program

Creating a flowchart for the program involves representing the logical flow of the program using standard symbols. Here's a simple textual representation of the flowchart for the program:

1. Start 2. Input values of a, b, and c 3. Calculate sum, product, max, and min values 4. Output the results 5. End

This textual representation can be converted into a visual flowchart using standard flowchart symbols.

I hope this helps! Let me know if you need further assistance.

0 0

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

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

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