Вопрос задан 18.02.2019 в 09:53. Предмет Информатика. Спрашивает Храмкова Арина.

Напишите программу на вычитание, деление и умножение (8-9 класс) На примере: program n_1 uses crt

var a, b, c: integar; begin writeln ('введите а: '); readln (а); writeln (введите b: '); readln (b); c:=a+b writeln ('сумма =', c); readkey; end.
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Савинков Денис.
Program n_1;
uses crt;
var
a, b, c: integer;
d:real;
begin
writeln ('введите а: ');
readln (a);
writeln ('введите b: ');
readln (b);
c:=a+b;
writeln ('сумма =', c);
c:=a*b;
writeln('произведение = ',c);
if b=0 then
writeln('деление на 0')
else
begin
d:=a/b;
writeln('деление = ',d:4:2);
end;
readkey;
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program for Subtraction, Division, and Multiplication in Pascal

Here is an example program in Pascal that performs subtraction, division, and multiplication:

```pascal program ArithmeticOperations; uses crt;

var a, b, c: integer;

begin writeln('Enter a:'); readln(a); writeln('Enter b:'); readln(b);

c := a - b; writeln('Subtraction result:', c);

c := a div b; writeln('Division result:', c);

c := a * b; writeln('Multiplication result:', c);

readkey; end. ```

This program prompts the user to enter two integers, `a` and `b`. It then performs the following operations:

1. Subtraction: `c := a - b` 2. Division: `c := a div b` 3. Multiplication: `c := a * b`

The results of each operation are displayed on the screen.

Please note that this program uses the `crt` unit for console input and output. The `readkey` procedure is used to wait for a key press before the program exits.

I hope this helps! Let me know if you have any further questions.

0 0

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

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

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