Вопрос задан 01.05.2019 в 14:51. Предмет Информатика. Спрашивает Самохвалов Макс.

Написать программу: выбрать наибольшее из двух вещественных чисел. Язык -Паскаль

0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Желізняк Юля.
Program mb;var a,b:integer;beginclrscr;writeln('vvedite a,b');readln(a,b);if a>b then writeln('большим является a')else writeln('большим является b');end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program to Find the Maximum of Two Real Numbers in Pascal

To write a program in Pascal to find the maximum of two real numbers, you can use the following code:

```pascal program FindMax; var a, b, max: real; begin write('Enter the first number: '); readln(a); write('Enter the second number: '); readln(b); if a > b then max := a else max := b; writeln('The maximum of ', a, ' and ', b, ' is ', max); end. ```

This program prompts the user to enter two real numbers and then compares them to find the maximum value.

Explanation of the Program

- The program starts by declaring three real variables: `a`, `b`, and `max`. - It then prompts the user to enter the first and second numbers using `write` and `readln` statements. - After reading the input, it compares the two numbers using an `if-else` statement to determine the maximum value. - Finally, it displays the result using the `writeln` statement.

This program effectively finds the maximum of two real numbers in Pascal.

Feel free to try running this program in your Pascal environment to see the result!

0 0

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

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

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